-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Range op to ONNX, make tvm arange shape_func support negative steps #6647
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.
Thanks @mbrookhart adding op support in onnx importer. LGTM
if step[0] < 0: | ||
out[0] = int64(ceil_div((int64(start[0]) - int64(stop[0])), int64(-step[0]))) | ||
else: | ||
out[0] = int64(ceil_div((int64(stop[0]) - int64(start[0])), int64(step[0]))) |
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.
It might be a good idea to add some tests for range with negative steps elsewhere besides the onnx importer (probably test_op_level3.py
).
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.
It looks like there are already tests with negative steps in test_op_level3.py, they just weren't hitting the shape_func
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.
Ok sounds good, thanks for confirming that!
Thanks @mbrookhart @jwfromm the PR has been merged! |
cc @icemelon9 @masahi @tmoreau89 @jwfromm