vandanavk commented on a change in pull request #14942: ONNX export: Slice op - 
Handle None value for ends
URL: https://github.com/apache/incubator-mxnet/pull/14942#discussion_r362656572
 
 

 ##########
 File path: python/mxnet/contrib/onnx/onnx2mx/_op_translations.py
 ##########
 @@ -499,15 +499,19 @@ def split(attrs, inputs, proto_obj):
 
 def _slice(attrs, inputs, proto_obj):
     """Returns a slice of the input tensor along multiple axes."""
+    input_tensor_data = proto_obj.model_metadata.get('input_tensor_data')[0]
+    input_shape = input_tensor_data[1]
     new_attrs = translation_utils._fix_attribute_names(attrs,
                                                        {'axes' : 'axis',
                                                         'ends' : 'end',
                                                         'starts' : 'begin'})
     # onnx slice provides slicing on multiple axis. Adding multiple slice_axis 
operator
     # for multiple axes from mxnet
     begin = new_attrs.get('begin')
-    end = new_attrs.get('end')
+    end = list(new_attrs.get('end'))
 
 Review comment:
   Its a required field in ONNX, will always exist 
https://github.com/onnx/onnx/blob/master/docs/Changelog.md#slice-1

----------------------------------------------------------------
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

Reply via email to