mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 05:34:18 +08:00
[Doc] Add Tensor.Shape
(#104750)
Summary: Add `Tensor.Shape` doc. Fix: #104038 Ref: - https://github.com/pytorch/pytorch/issues/5544 - https://github.com/pytorch/pytorch/issues/1980 Differential Revision: D47278630 CC: @svekars @carljparker Pull Request resolved: https://github.com/pytorch/pytorch/pull/104750 Approved by: https://github.com/mikaylagawarecki
This commit is contained in:
committed by
PyTorch MergeBot
parent
28a4fc8d8a
commit
c0c208516b
@ -4727,6 +4727,26 @@ Example::
|
||||
""",
|
||||
)
|
||||
|
||||
add_docstr_all(
|
||||
"shape",
|
||||
r"""
|
||||
shape() -> torch.Size
|
||||
|
||||
Returns the size of the :attr:`self` tensor. Alias for :attr:`size`.
|
||||
|
||||
See also :meth:`Tensor.size`.
|
||||
|
||||
Example::
|
||||
|
||||
>>> t = torch.empty(3, 4, 5)
|
||||
>>> t.size()
|
||||
torch.Size([3, 4, 5])
|
||||
>>> t.shape
|
||||
torch.Size([3, 4, 5])
|
||||
|
||||
""",
|
||||
)
|
||||
|
||||
add_docstr_all(
|
||||
"sort",
|
||||
r"""
|
||||
|
Reference in New Issue
Block a user