Skip to content

Conversation

@mbrookhart
Copy link
Contributor

cc @icemelon9 @masahi @tmoreau89 @jwfromm

Copy link
Contributor

@tmoreau89 tmoreau89 left a 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])))
Copy link
Contributor

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

Copy link
Contributor Author

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

Copy link
Contributor

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!

@tmoreau89 tmoreau89 merged commit a919824 into apache:master Oct 8, 2020
@tmoreau89
Copy link
Contributor

Thanks @mbrookhart @jwfromm the PR has been merged!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants