Roshrini commented on a change in pull request #12633: Onnx version update from
1.2.1 to 1.3 in CI
URL: https://github.com/apache/incubator-mxnet/pull/12633#discussion_r219928709
##########
File path: python/mxnet/contrib/onnx/onnx2mx/_op_translations.py
##########
@@ -118,11 +118,23 @@ def add_n(attrs, inputs, proto_obj):
# Sorting and Searching
def argmax(attrs, inputs, proto_obj):
"""Returns indices of the maximum values along an axis"""
- return 'argmax', attrs, inputs
+ new_attrs = translation_utils._fix_attribute_names(attrs, {'axis': 'axis',
+ 'keepdims':
'keepdims'})
+ axis = new_attrs.get('axis', 0)
+ keepdims = new_attrs.get('keepdims', 0)
+ argmax_op = symbol.argmax(inputs[0], axis=axis, keepdims=keepdims)
+ cast_attrs = {'dtype': 'int64'}
Review comment:
argmax/argmin output is always int64 in onnx
https://github.com/onnx/onnx/blob/master/docs/Operators.md#ArgMax
Tests will fail otherwise
----------------------------------------------------------------
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