viiccwen opened a new pull request, #20000: URL: https://github.com/apache/tvm/pull/20000
The ONNX `Range` importer uses the dtype of the start value as the output dtype for `relax.op.arange`. The frontend previously passed `start.ty.dtype`, which is a `PrimType` wrapper rather than the underlying `DataType` expected by `arange`. This patch passes the underlying dtype with `start.ty.dtype.dtype`. The regression test covers a shape-derived bound produced by `Shape -> Gather -> Range`, and checks that the imported Relax IR contains `R.arange(..., dtype="int64")`. Verification: - `python -m pytest tests/python/relax/test_frontend_onnx.py::test_range_with_primexpr_limit -q` - `pre-commit run --files python/tvm/relax/frontend/onnx/onnx_frontend.py tests/python/relax/test_frontend_onnx.py` Fixes #19999. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
