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])