mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 05:34:18 +08:00
[primTorch] Improve narrow
and narrow_copy
: refs, tests, docs (#87045)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/87045 Approved by: https://github.com/mruberry
This commit is contained in:
committed by
PyTorch MergeBot
parent
6e5f736d86
commit
4270bb37da
@ -3436,18 +3436,7 @@ add_docstr_all(
|
||||
r"""
|
||||
narrow(dimension, start, length) -> Tensor
|
||||
|
||||
See :func:`torch.narrow`
|
||||
|
||||
Example::
|
||||
|
||||
>>> x = torch.tensor([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
|
||||
>>> x.narrow(0, 0, 2)
|
||||
tensor([[ 1, 2, 3],
|
||||
[ 4, 5, 6]])
|
||||
>>> x.narrow(1, 1, 2)
|
||||
tensor([[ 2, 3],
|
||||
[ 5, 6],
|
||||
[ 8, 9]])
|
||||
See :func:`torch.narrow`.
|
||||
""",
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user