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
torch.reciprocal
: promote integer inputs to float
#49102
Conversation
💊 CI failures summary and remediationsAs of commit 4d9b345 (more details on the Dr. CI page):
1 job timed out:
🚧 1 fixed upstream failure:These were probably caused by upstream breakages that were already fixed.
Please rebase on the
|
torch.reciprocal
: promote integer inputs to float
…to reciprocal-type-promo
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.
Hey @soulitzer. Overall this looks very good. I made some inline comments.
I think this PR should also update reciprocal's documentation to clarify the integer behavior and note its different from NumPy's reciprocal. This should probably be done in a note.
Reason for disabling
|
Tests failures are unrelated. |
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.
Nice work, @soulitzer! It's great that reciprocal is finally being tested with zero, and we have better undefined behavior annotations. It's also nice that we're improving over NumPy's behavior by defining reciprocal for integers sensibly.
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.
@soulitzer has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
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.
@soulitzer has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
@soulitzer merged this pull request in 5ab9593. |
Summary: Fixes pytorch#49091 Pull Request resolved: pytorch#49102 Reviewed By: VitalyFedyunin Differential Revision: D25639541 Pulled By: soulitzer fbshipit-source-id: 1dd360bd7b77f106d606143d8d3961610bac8cb7
Fixes #49091