On this page
torch.Tensor.shape
Tensor.shape-
Returns the size of the
selftensor. Alias forsize.See also
Tensor.size().Example:
>>> t = torch.empty(3, 4, 5) >>> t.size() torch.Size([3, 4, 5]) >>> t.shape torch.Size([3, 4, 5])
© 2024, PyTorch Contributors
PyTorch has a BSD-style license, as found in the LICENSE file.
https://pytorch.org/docs/2.1/generated/torch.Tensor.shape.html