y =x = torch.tensor([1, 0])
x = torch.unsqueeze(x, dim=1)
print(x)
y = torch.unsqueeze(y, dim=0)
print(y)
# tensor([[1],
# [0]])
# tensor([[1, 0]])
Example of using torch.unsqueeze function
Guess you like
Origin blog.csdn.net/djdjdhch/article/details/130600281
Recommended
Ranking