torch.Tensor.shape¶
- Tensor.shape¶
傳回
self
張量的尺寸。是size
的別名。另請參閱
Tensor.size()
。範例
>>> t = torch.empty(3, 4, 5) >>> t.size() torch.Size([3, 4, 5]) >>> t.shape torch.Size([3, 4, 5])
傳回 self
張量的尺寸。是 size
的別名。
另請參閱 Tensor.size()
。
範例
>>> t = torch.empty(3, 4, 5)
>>> t.size()
torch.Size([3, 4, 5])
>>> t.shape
torch.Size([3, 4, 5])