-
Notifications
You must be signed in to change notification settings - Fork 26.3k
update doc for multinomial #17269
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
update doc for multinomial #17269
Conversation
| :attr:`input` length (or number of columns of :attr:`input` if it is a matrix). | ||
| .. note:: | ||
| When drawn without replacement, :attr:`num_samples` must be lower than | ||
| number of non-zero elements in :attr:`input` (or the min number of non-zero |
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.
The example below is still outdated.
ssnl
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.
All good except for 1 nit
| tensor([ 1, 2, 0, 0]) | ||
| >>> torch.multinomial(weights, 2) | ||
| tensor([1, 2]) | ||
| >>> torch.multinomial(weights, 4) # ERROR! |
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'd add a few words explaining the error. Adding the error message here would also be useful.
39a46e6 to
83291b5
Compare
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.
@ailzhang has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Summary: Update documentation to raise awareness of the fix in pytorch#12490. Thanks matteorr for pointing this out! Pull Request resolved: pytorch#17269 Reviewed By: ezyang Differential Revision: D14138421 Pulled By: ailzhang fbshipit-source-id: 6433f9807a6ba1d871eba8e9d37aa6b78fa1e1fd
Update documentation to raise awareness of the fix in #12490. Thanks @matteorr for pointing this out!