-
Notifications
You must be signed in to change notification settings - Fork 6.8k
[MXNET-885] ONNX export - Clip operator #12457
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor comments - please make the code more pythonic
attrs['a_max'] = np.inf | ||
if 'a_min' not in attrs: | ||
attrs['a_min'] = -np.inf | ||
a_min = float(attrs["a_min"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove the if statement above and replace this line with -
a_min = np.float(attrs.get('a_min', -np.inf))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @anirudhacharya. I was planning to change it to
a_min = float(attrs["a_min"]) if "a_min" in attrs else -np.inf
But I think I'll go ahead with your suggestion.
if 'a_min' not in attrs: | ||
attrs['a_min'] = -np.inf | ||
a_min = float(attrs["a_min"]) | ||
a_max = float(attrs["a_max"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove the if statement above and replace this line with -
a_max = np.float(attrs.get('a_max', np.inf))
@zhreshold - PR for review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
30f24a6
to
1a8f807
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks.
Description
Adding Clip operator to ONNX export
Checklist
Essentials
Please feel free to remove inapplicable items for your PR.
Changes
Comments
@Roshrini @anirudhacharya