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_r319693989
##########
File path: python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
##########
@@ -1499,17 +1500,19 @@ def convert_slice_axis(node, **kwargs):
axes = int(attrs.get("axis"))
starts = int(attrs.get("begin"))
- ends = int(attrs.get("end", None))
- if not ends:
- raise ValueError("Slice: ONNX doesnt't support 'None' in 'end'
attribute")
+ ends = attrs.get("end", None)
+ if not ends or ends == 'None':
+ # ONNX doesn't support None for ends. Since ends=None depicts
Review comment:
I think it is sufficient to map None to the dimension of the particular
axis. Changing this in the next iteration.
----------------------------------------------------------------
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