赞
踩
一个例子
import torch dim3=torch.rand(2,3,4) print(dim3) print(dim3.shape[0]) print(dim3.shape[1]) print(dim3.shape[2])
运行结果 显然shape输出张量对应的维度