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 2020/01/02 22:37:55 UTC

[GitHub] [incubator-mxnet] anirudhacharya commented on a change in pull request #14942: ONNX export: Slice op - Handle None value for ends

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

 ##########
 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:
   if `end` does not exist in new_attrs, converting it to a list will throw NoneType error

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


With regards,
Apache Git Services