import torch
a =[[[1], [2], [3]], [[4], [5], [6]]]
a = torch.tensor(a)
print(a.shape)
print(len(a))
结果:
torch.Size([2, 3, 1])
2
其中[2, 3, 1]分别依次对应从内到里的括号里面的数据个数:
2
3
1
import torch
a =[[[1], [2], [3]], [[4], [5], [6]]]
a = torch.tensor(a)
print(a.shape)
print(len(a))
结果:
torch.Size([2, 3, 1])
2
其中[2, 3, 1]分别依次对应从内到里的括号里面的数据个数:
2
3
1