📅  最后修改于: 2022-03-11 14:45:45.478000             🧑  作者: Mango
# ADD ONE DIMENSION: .unsqueeze(dim)
my_tensor = torch.tensor([1,3,4])
# tensor([1,3,4])
my_tensor.unsqueeze(0)
# tensor([[1,3,4]])
my_tensor.unsqueeze(1)
# tensor([[1],
# [3],
# [4]])