kazum commented on a change in pull request #5073: [Relay][Frontend][ONNX]
operator support NonZero
URL: https://github.com/apache/incubator-tvm/pull/5073#discussion_r393505835
##########
File path: python/tvm/relay/frontend/onnx.py
##########
@@ -1443,6 +1443,16 @@ def _impl_v11(cls, inputs, attr, params):
return _op.image.resize(inputs[0], out_size, layout, method,
coord_trans)
+class NonZero(OnnxOpConverter):
+ """Operator converter for NonZero
+ """
+ @classmethod
+ def _impl_v9(cls, inputs, attr, params):
+ if len(inputs) > 1:
+ raise ValueError("Expect 1 input only")
+ return AttrCvt(op_name='argwhere')(inputs, attr, params)
Review comment:
The output shape of argwhere is different from the one of ONNX nonzero.
Needs transpose here.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services