-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Add docstring for torch.slice
#7902
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
| :attr:`dim` between the indices given by integer inputs :attr:`start` and | ||
| :attr:`stop` with the corresponding :attr:`step`, which is an integer. | ||
| The returned tensor has the same number of dimensions as the original tensor |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| The returned tensor has the same number of dimensions as the original tensor | ||
| (:attr:`input`). The size of the :attr:`dim`\ th dimension is given by | ||
| ``ceil((min(stop, input.size(dim)) - start) / step)`` |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
I'm not sure the test failures are relevant? |
|
@pytorchbot retest this please |
|
I think it shouldn't be part of the Python API. It has no benefits over regular indexing. |
|
Ok, thanks for the feedback. I would propose closing this PR and opening a new one that removes the Python bindings for the |
|
Closing this in favor of #7924. |
I noticed that
torch.slicedoes not have a docstring (I assume it is an oversight?), so this patch adds docstrings fortorch.sliceandtensor.slice.I built docs with
make htmland inspected them. If there are other checks or changes that need to be made that I have missed, please let me know.