You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2021/02/05 21:41:25 UTC

[GitHub] [incubator-mxnet] Zha0q1 opened a new pull request #19854: [v1.x] ONNX support for argsort

Zha0q1 opened a new pull request #19854:
URL: https://github.com/apache/incubator-mxnet/pull/19854


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-mxnet] mxnet-bot commented on pull request #19854: [v1.x] ONNX support for argsort

Posted by GitBox <gi...@apache.org>.
mxnet-bot commented on pull request #19854:
URL: https://github.com/apache/incubator-mxnet/pull/19854#issuecomment-774303574


   Hey @Zha0q1 , Thanks for submitting the PR 
   All tests are already queued to run once. If tests fail, you can trigger one or more tests again with the following commands: 
   - To trigger all jobs: @mxnet-bot run ci [all] 
   - To trigger specific jobs: @mxnet-bot run ci [job1, job2] 
   *** 
   **CI supported jobs**: [edge, website, miscellaneous, unix-cpu, windows-gpu, centos-cpu, sanity, centos-gpu, unix-gpu, clang, windows-cpu]
   *** 
   _Note_: 
    Only following 3 categories can trigger CI :PR Author, MXNet Committer, Jenkins Admin. 
   All CI tests must pass before the PR can be merged. 
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-mxnet] waytrue17 commented on a change in pull request #19854: [v1.x] ONNX support for argsort

Posted by GitBox <gi...@apache.org>.
waytrue17 commented on a change in pull request #19854:
URL: https://github.com/apache/incubator-mxnet/pull/19854#discussion_r571267003



##########
File path: python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
##########
@@ -3871,3 +3872,42 @@ def convert_log2(node, **kwargs):
     ]
 
     return nodes
+
+
+@mx_op.register('argsort')
+def convert_argsort(node, **kwargs):
+    """Map MXNet's argsort operator attributes to onnx's TopK operator
+    """
+    from onnx.helper import make_node
+    name, input_nodes, attrs = get_inputs(node, kwargs)
+
+    opset_version = kwargs['opset_version']
+    if opset_version < 11:
+        raise AttributeError('ONNX opset 11 or greater is required to export this operator')
+
+    axis = int(attrs.get('axis', '-1'))
+    is_ascend = attrs.get('is_ascend', 'True')
+    print(is_ascend)

Review comment:
       we can remove the print line:)




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-mxnet] Zha0q1 merged pull request #19854: [v1.x] ONNX support for argsort

Posted by GitBox <gi...@apache.org>.
Zha0q1 merged pull request #19854:
URL: https://github.com/apache/incubator-mxnet/pull/19854


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-mxnet] Zha0q1 commented on a change in pull request #19854: [v1.x] ONNX support for argsort

Posted by GitBox <gi...@apache.org>.
Zha0q1 commented on a change in pull request #19854:
URL: https://github.com/apache/incubator-mxnet/pull/19854#discussion_r571271122



##########
File path: python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
##########
@@ -3871,3 +3872,42 @@ def convert_log2(node, **kwargs):
     ]
 
     return nodes
+
+
+@mx_op.register('argsort')
+def convert_argsort(node, **kwargs):
+    """Map MXNet's argsort operator attributes to onnx's TopK operator
+    """
+    from onnx.helper import make_node
+    name, input_nodes, attrs = get_inputs(node, kwargs)
+
+    opset_version = kwargs['opset_version']
+    if opset_version < 11:
+        raise AttributeError('ONNX opset 11 or greater is required to export this operator')
+
+    axis = int(attrs.get('axis', '-1'))
+    is_ascend = attrs.get('is_ascend', 'True')
+    print(is_ascend)

Review comment:
       Right!




----------------------------------------------------------------
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:
users@infra.apache.org