-
Notifications
You must be signed in to change notification settings - Fork 56
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
[torchlib] Fix aten::diagonal #1755
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1755 +/- ##
==========================================
- Coverage 75.07% 75.06% -0.01%
==========================================
Files 245 245
Lines 26443 26437 -6
Branches 4824 4822 -2
==========================================
- Hits 19852 19846 -6
Misses 5660 5660
Partials 931 931 ☔ View full report in Codecov by Sentry. |
Test Results 24 files ±0 24 suites ±0 3h 14m 26s ⏱️ -8s For more details on these failures, see this check. Results for commit 27cf0e0. ± Comparison against base commit a72f048. This pull request removes 2 tests.
♻️ This comment has been updated with latest results. |
If possible, it'd better paste the error we saw into description so we know what kind of logic was fixed. |
Done, thanks. |
neg_1 = op.Constant(value_ints=[-1]) | ||
dim1_size = op.Reshape(op.Gather(op.Shape(self), dim1), neg_1) # row | ||
dim2_size = op.Reshape(op.Gather(op.Shape(self), dim2), neg_1) # col | ||
dim1_size = op.Shape(self, end=dim1, start=dim1 + 1) # row |
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.
Can dim1
be negative? Especially -1? Same for dim2
.
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.
ah it can. Thanks for pointing this out!
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.
Reverted to use gather. Added a comment
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.
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.
In any case using Shape(start, end) does not work for some reason
Turn aten::diagonal as trace only and fix its logic by explicitly converting python constants to onnx constants. This was needed because the exporter logic was not handling the type conversion correctly (yet)