Expected behavior
The Relax ONNX frontend should import Range successfully when one of its bounds is derived from ONNX shape operators. The generated relax.arange call should receive the underlying scalar DataType, such as int64.
Actual behavior
The Range importer reads the output dtype from start.ty.dtype. This is a Relax PrimType wrapper, while relax.op.arange expects the underlying DataType.
This can break imports when a Range bound comes from a shape-derived PrimExpr, causing the importer to take the graph-building path instead of constant folding.
Minimal pattern
Shape(x) -> Gather(axis=0) -> limit
Range(start=0, limit=limit, delta=1) -> output
Proposed fix
Pass start.ty.dtype.dtype to relax.op.arange and add a regression test covering the shape-derived bound.
Expected behavior
The Relax ONNX frontend should import
Rangesuccessfully when one of its bounds is derived from ONNX shape operators. The generatedrelax.arangecall should receive the underlying scalarDataType, such asint64.Actual behavior
The
Rangeimporter reads the output dtype fromstart.ty.dtype. This is a RelaxPrimTypewrapper, whilerelax.op.arangeexpects the underlyingDataType.This can break imports when a
Rangebound comes from a shape-derivedPrimExpr, causing the importer to take the graph-building path instead of constant folding.Minimal pattern
Proposed fix
Pass
start.ty.dtype.dtypetorelax.op.arangeand add a regression test covering the shape-derived bound.