Skip to content

Commit b09c919

Browse files
PatrikPerssonInceptrontqchen
authored andcommitted
Fixed neg operator conversion
Updated arange converter to use relax.op.arange instead of emitting a tir arange
1 parent d3a2ed6 commit b09c919

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

python/tvm/relax/frontend/onnx/onnx_frontend.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1526,6 +1526,8 @@ def _impl_v13(cls, bb, inputs, attr, params):
15261526
if isinstance(inputs[0], relax.Constant):
15271527
data_np = inputs[0].data.numpy()
15281528
return relax.const(_np.negative(data_np), inputs[0].struct_info.dtype)
1529+
if isinstance(inputs[0], relax.PrimValue):
1530+
return relax.PrimValue(-inputs[0].value)
15291531
return relax.op.negative(inputs[0])
15301532

15311533

@@ -2189,7 +2191,7 @@ def _impl_v12(cls, bb, inputs, attr, params):
21892191
return relax.const(out_range, out_dtype)
21902192

21912193
# Otherwise compute in graph.
2192-
return bb.emit_te(topi.arange, start, limit, step, out_dtype)
2194+
return relax.op.arange(start, limit, step, out_dtype)
21932195

21942196

21952197
class InstanceNormalization(OnnxOpConverter):

0 commit comments

Comments
 (0)