Rate this Page

torch.Tensor.shape#

Tensor.shape#

Returns the size of theself tensor. Alias forsize.

See alsoTensor.size().

Example:

>>>t=torch.empty(3,4,5)>>>t.size()torch.Size([3, 4, 5])>>>t.shapetorch.Size([3, 4, 5])