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
Fix torch.bucketize docs for "right" #104474
Fix torch.bucketize docs for "right" #104474
Conversation
The docs correctly (i.e matching actual op behavior) state that `right = False` means `boundaries[i-1] < input[m][n]...[l][x] <= boundaries[i]`. However they previously stated that `If 'right' is False (default), then the left boundary is closed.` which contradicts the `boundaries[i-1] < input[m][n]...[l][x] <= boundaries[i]` statement. This modifies the docs to say `... then the left boundary is OPEN.` and also clarifies that this is the opposite behavior of numpy.digitize. [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/104474
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 9159edc with merge base 1f6c1d9 (): This comment was automatically generated by Dr. CI and updates every 15 minutes. |
The docs correctly (i.e matching actual op behavior) state that `right = False` means `boundaries[i-1] < input[m][n]...[l][x] <= boundaries[i]`. However they previously stated that `If 'right' is False (default), then the left boundary is closed.` which contradicts the `boundaries[i-1] < input[m][n]...[l][x] <= boundaries[i]` statement. This modifies the docs to say `... then the left boundary is OPEN.` and also clarifies that this is the opposite behavior of numpy.digitize. ghstack-source-id: b830fa57419cb2b86d42f84564f9ec500fd342a6 Pull Request resolved: #104474
@pytorchbot rebase -s |
@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here |
The docs correctly (i.e matching actual op behavior) state that `right = False` means `boundaries[i-1] < input[m][n]...[l][x] <= boundaries[i]`. However they previously stated that `If 'right' is False (default), then the left boundary is closed.` which contradicts the `boundaries[i-1] < input[m][n]...[l][x] <= boundaries[i]` statement. This modifies the docs to say `... then the left boundary is OPEN.` and also clarifies that this is the opposite behavior of numpy.digitize. Fixes #91580 [ghstack-poisoned]
Successfully rebased |
The docs correctly (i.e matching actual op behavior) state that `right = False` means `boundaries[i-1] < input[m][n]...[l][x] <= boundaries[i]`. However they previously stated that `If 'right' is False (default), then the left boundary is closed.` which contradicts the `boundaries[i-1] < input[m][n]...[l][x] <= boundaries[i]` statement. This modifies the docs to say `... then the left boundary is OPEN.` and also clarifies that this is the opposite behavior of numpy.digitize. ghstack-source-id: 641dc9124bc6075dfe15faaf70ff29a5e843e612 Pull Request resolved: #104474
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.
Thanks for the fix!
@pytorchbot merge |
Merge failedReason: Approval needed from one of the following: |
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.
One nit, but LGTM! Check the output here as well.
torch/_torch_docs.py
Outdated
formally, the returned index satisfies the following rules: | ||
as :attr:`input`. If :attr:`right` is False (default), then the left boundary is open. Note that | ||
this behavior is opposite the behavior of | ||
`numpy.digitize <https://docs.scipy.org/doc/numpy/reference/generated/numpy.digitize.html>`_ |
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.
`numpy.digitize <https://docs.scipy.org/doc/numpy/reference/generated/numpy.digitize.html>`_ | |
`numpy.digitize <https://docs.scipy.org/doc/numpy/reference/generated/numpy.digitize.html>`_. |
…cs for "right"" The docs correctly (i.e matching actual op behavior) state that `right = False` means `boundaries[i-1] < input[m][n]...[l][x] <= boundaries[i]`. However they previously stated that `If 'right' is False (default), then the left boundary is closed.` which contradicts the `boundaries[i-1] < input[m][n]...[l][x] <= boundaries[i]` statement. This modifies the docs to say `... then the left boundary is OPEN.` and also clarifies that this is the opposite behavior of numpy.digitize. Fixes #91580 [ghstack-poisoned]
The docs correctly (i.e matching actual op behavior) state that `right = False` means `boundaries[i-1] < input[m][n]...[l][x] <= boundaries[i]`. However they previously stated that `If 'right' is False (default), then the left boundary is closed.` which contradicts the `boundaries[i-1] < input[m][n]...[l][x] <= boundaries[i]` statement. This modifies the docs to say `... then the left boundary is OPEN.` and also clarifies that this is the opposite behavior of numpy.digitize. ghstack-source-id: 718098d6f075f8a7394200cbfea261405c13d6e8 Pull Request resolved: #104474
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Stack from ghstack:
The docs correctly (i.e matching actual op behavior) state that
right = False
meansboundaries[i-1] < input[m][n]...[l][x] <= boundaries[i]
.However they previously stated that
If 'right' is False (default), then the left boundary is closed.
which contradicts the
boundaries[i-1] < input[m][n]...[l][x] <= boundaries[i]
statement.This modifies the docs to say
... then the left boundary is OPEN.
and also clarifies that this is the opposite behavior of numpy.digitize.Fixes #91580