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 2018/12/27 00:42:11 UTC

[GitHub] vandanavk commented on a change in pull request #13717: ONNX import: Hardmax

vandanavk commented on a change in pull request #13717: ONNX import: Hardmax
URL: https://github.com/apache/incubator-mxnet/pull/13717#discussion_r244065080
 
 

 ##########
 File path: python/mxnet/contrib/onnx/onnx2mx/_op_translations.py
 ##########
 @@ -714,3 +714,28 @@ def spacetodepth(attrs, inputs, proto_obj):
     new_attrs = translation_utils._fix_attribute_names(attrs, {'blocksize':'block_size'})
 
     return "space_to_depth", new_attrs, inputs
+
+
+def hardmax(attrs, inputs, proto_obj):
+    """Returns batched one-hot vectors."""
+    input_tensor_data = proto_obj.model_metadata.get('input_tensor_data')[0]
+    input_shape = input_tensor_data[1]
+
+    axis = int(attrs.get('axis', 1))
 
 Review comment:
   As discussed offline:
   
   if axis is negative, the else part of the next statement will set axis to the offset from the start. Example, if length=5 and axis=-2, new axis will be 3.
   In case axis is positive, it will maintain the same value for axis.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


With regards,
Apache Git Services