-
Notifications
You must be signed in to change notification settings - Fork 26.3k
include type promotion info in torch.add/mul/div documentation #27501
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
a5a334e to
bd9d98b
Compare
bd9d98b to
38f2da3
Compare
|
I'm confused -- does this supercede #25114? |
torch/_torch_docs.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.
I want to point out that numpy makes no mention of type promotion in their doc: https://docs.scipy.org/doc/numpy/reference/generated/numpy.add.html
38f2da3 to
d9032db
Compare
|
@pytorchbot retest this please |
gchanan
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.
sorry, getting to this late.
| Args: | ||
| {input} | ||
| value (Number): the number to be added to each element of :attr:`input` | ||
| If the :class:`torch.dtype` of :attr:`input` and :attr:`other` differ, |
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.
does this "if" add anything? The the rules of type promotion apply even if the dtypes are the same, right?
| If :attr:`input` is of type `FloatTensor` or `DoubleTensor`, :attr:`other` | ||
| should be a real number, otherwise it should be an integer | ||
| If the :class:`torch.dtype` of :attr:`input` and :attr:`other` differ, |
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.
same here.
| If :attr:`input` is of type `FloatTensor` or `DoubleTensor`, :attr:`other` | ||
| should be a real number, otherwise it should be an integer | ||
| If the :class:`torch.dtype` of :attr:`input` and :attr:`other` differ, |
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.
same here.
Related to #25114 but would like to improve torch.add doc on release branch.
Issue: #26825
FYI: @xuhdev