-
Notifications
You must be signed in to change notification settings - Fork 24.1k
Update _torch_docs.py to Fix torch.bernoulli() #152104
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
base: main
Are you sure you want to change the base?
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/152104
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ❌ 3 New FailuresAs of commit 29eee38 with merge base d743a7b ( NEW FAILURES - The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
p (float): should be a scalar containing probabilities to be used | ||
for drawing the binary random number. |
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.
Copy and changed according to:
Lines 840 to 859 in d743a7b
add_docstr_all( | |
"bernoulli_", | |
r""" | |
bernoulli_(p=0.5, *, generator=None) -> Tensor | |
Fills each location of :attr:`self` with an independent sample from | |
:math:`\text{Bernoulli}(\texttt{p})`. :attr:`self` can have integral | |
``dtype``. | |
:attr:`p` should either be a scalar or tensor containing probabilities to be | |
used for drawing the binary random number. | |
If it is a tensor, the :math:`\text{i}^{th}` element of :attr:`self` tensor | |
will be set to a value sampled from | |
:math:`\text{Bernoulli}(\texttt{p\_tensor[i]})`. In this case `p` must have | |
floating point ``dtype``. | |
See also :meth:`~Tensor.bernoulli` and :func:`torch.bernoulli` | |
""", | |
) |
Fixes #152095
@malfet Wondering whether to fix signature that from:
to
Or just merge them two to:
which can cover the original both signatures.