Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RELAX][ONNX] Add prim experssion support to Neg converter and update Arange converter to use relax.op.arange #17566

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion python/tvm/relax/frontend/onnx/onnx_frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -1526,6 +1526,8 @@ def _impl_v13(cls, bb, inputs, attr, params):
if isinstance(inputs[0], relax.Constant):
data_np = inputs[0].data.numpy()
return relax.const(_np.negative(data_np), inputs[0].struct_info.dtype)
if isinstance(inputs[0], relax.PrimValue):
return relax.PrimValue(-inputs[0].value)
return relax.op.negative(inputs[0])


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

# Otherwise compute in graph.
return bb.emit_te(topi.arange, start, limit, step, out_dtype)
return relax.op.arange(start, limit, step, out_dtype)


class InstanceNormalization(OnnxOpConverter):
Expand Down
Loading