PytorchTensor.size和Tensor.shapePytorch 中的区别是什么?我想获取元素的数量和张量的维度。例如,对于尺寸为 2 x 3 x 4 的张量,我希望元素数量为 24,维度为 (2,3,4)。谢谢。
Tensor.size
Tensor.shape
pytorch
pytorch ×1