vandanavk commented on a change in pull request #13806: ONNX ops: norm exported
and lpnormalization imported
URL: https://github.com/apache/incubator-mxnet/pull/13806#discussion_r246223293
##########
File path: python/mxnet/contrib/onnx/onnx2mx/_op_translations.py
##########
@@ -740,3 +740,13 @@ def hardmax(attrs, inputs, proto_obj):
one_hot = symbol.one_hot(amax, depth=new_shape[-1])
hardmax_op = symbol.reshape(one_hot, input_shape)
return hardmax_op, attrs, inputs
+
+def lpnormalization(attrs, inputs, proto_obj):
+ """ONNX does not have eps attribute, so cannot map it to L2normalization
in MXNet
+ without that, it works as norm operator discussion in PR:
+ https://github.com/onnx/onnx/pull/1330"""
+ new_attrs = translation_utils._fix_attribute_names(attrs, {'p': 'ord'})
+ axis = int(attrs.get("axis", -1))
+ new_attrs.update(axis=axis)
Review comment:
should translation_utils._add_extra_attributes be used?
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services