-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Return NotImplemented from all binary math ops #27423
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
Conversation
torch/tensor.py
Outdated
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 you remind me why we don't implement the wrapping here directly in C++?
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 doesn't make sense to return NotImplemented from Tensor.eq which is what this is wrapping.
test/test_torch.py
Outdated
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.
cc @mruberry (any thoughts here?)
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.
This is well-written and makes good use of the existing test infrastructure. It may be test overkill to add hundreds of tests for this behavior, but as long as these take <1s to run it's fine. (You can check the timestamps in the CI.)
ezyang
left 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.
OK. I'll leave a little time for mruberry to take a look and then merge.
test/test_torch.py
Outdated
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.
Not "TestDevicePrecision" per below. You should acquire the class name from cls.
|
I strongly suspect the onnx test failures are real. Probbabbbly just accepting the changes should be fine |
|
I'm not familiar with ONNX, does it depend on the parameter names in the function signature? If that's the case then could this error be caused by |
|
@houseroad for ONNX question |
|
@peterbell10 Yes, I don't exactly remember how argument name inference is done, but it certainly seems plausible that decorator is thwarting (or un-thwarting, perhaps) the name inference. The names are all advisory anyway; if the graphs are alpha-equivalent either is fine. |
Okay, in that case I've just updated the test cases. |
|
@pytorchbot rebase this please |
facebook-github-bot
left 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.
@ezyang has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
Sorry, it looks like this merge conflicts now :( |
6ea268b to
15bf25b
Compare
|
Still failing tests |
15bf25b to
a49c663
Compare
|
Should be fixed now. |
|
@pytorchbot rebase this please |
facebook-github-bot
left 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.
@ezyang is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Fixes #26333
Fixes the operators missed in #26507 and includes a test for all operators.