torch.Tensor.size
-
Tensor.
size
() → torch.Size Returns the size of the
self
tensor. The returned value is a subclass oftuple
.Example:
>>> torch.empty(3, 4, 5).size() torch.Size([3, 4, 5])
Tensor.
size
() → torch.SizeReturns the size of the self
tensor. The returned value is a subclass of
tuple
.
Example:
>>> torch.empty(3, 4, 5).size()
torch.Size([3, 4, 5])