c.reshape(2, 3)
# c.view(2, 3)
【output】
tensor([[0, 1, 2, 3],
[4, 5, 6, 7]])
2、cat
多个tensor向量在某个维度上进行拼接...【output】
tensor([[0., 0., 0., 1., 1., 1.],
[0., 0., 0., 1., 1., 1.]])
3、stack
多个tensor向量在某个维度上进行堆叠...[1., 1., 1.]],
[[0., 0., 0.],
[1., 1., 1.]]])
4、squeeze
对tensor向量进行压缩,删除元素个数为1的维度...,添加元素个数为1的维度。...)
# c.unsqueeze(dim=1)
【output】
tensor([[[0, 1, 2]],
[[3, 4, 5]]])
6、transpose
对tensor向量的两个维度进行转置