-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Documents sub properly, adds subtract alias #43850
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
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.
@mruberry has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
torch/_torch_docs.py
Outdated
| """ + r""" | ||
| When :attr:`other` is a tensor, the shape of :attr:`other` must be | ||
| :ref:`broadcastable <broadcasting-semantics>` with the shape of the underlying |
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.
what's underlying tensor?
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.
Who knows?
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.
Per offline conversation: this note will be modernized to "This op supports..." and include a broadcasting and type promotion reference.
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.
@mruberry has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Codecov Report
@@ Coverage Diff @@
## master #43850 +/- ##
=======================================
Coverage 69.32% 69.32%
=======================================
Files 378 378
Lines 46745 46749 +4
=======================================
+ Hits 32404 32407 +3
- Misses 14341 14342 +1
Continue to review full report at Codecov.
|
|
A request: please don't make unrelated whitespace changes in PRs; this just cost me another failed land (will have to try again tomorrow) |
|
Sorry about that @ezyang. I'll change my editor to not auto-truncate lines. |
|
Or better yet, add a lint rule to prevent trailing whitespace and banish it from the codebase entirely :) |
torch.subwas undocumented, so this PR adds its documentation, analogous totorch.add's documentation, and adds the aliastorch.subtractfortorch.sub, too. This alias comes from NumPy (see https://numpy.org/doc/stable/reference/generated/numpy.subtract.html?highlight=subtract#numpy.subtract)