查看一个张量的维度和一个列表的维度
# 查看一个张量的维度和一个列表的维度
import torch
a = torch.tensor([[8, 9, 6, 5], [1, 2, 5, 8]])
print("a:", a)
print("a size:", a.size())
b = [[8, 9, 6, 5], [1, 2, 5, 8]]
c = torch.tensor(b)
print("c:", c)
print("c size:", c.size())
print("b:", b)
print("b size:", b.size())
![在这里插入图片描述](https://img-blog.csdnimg.cn/23844951d97340e88dca4c8d2cd30074.png)