Pytorch 中的 Tensor.size 和 Tensor.shape 有什么区别? 我想获取元素的数量和张量的维度。例如,对于尺寸为2 x 3 x 4 的张量,我希望元素数量为24,维度为(2,3,4)。
確定! 回上一頁