., 1.]])
3、stack
多个tensor向量在某个维度上进行堆叠。注意的是:stack只是torch的函数。...., 1.]]])
4、squeeze
对tensor向量进行压缩,删除元素个数为1的维度。...torch.squeeze(c)
# c.squeeze()
【output】
tensor([[0, 1, 2],
[3, 4, 5]])
5、unsqueeze
对tensor向量的维度进行扩充...,添加元素个数为1的维度。...c.transpose(1, 2)
【output】
tensor([[[0, 3],
[1, 4],
[2, 5]]])
7、permute
对tensor向量的多个维度进行转置