pytorch里面的tensor与numpy,variable区别

# torch.Tensor(1,2,3) 与 torch.Tensor([1,2,3]) 的区别
torch.Tensor( 1, 2, 3) # 生成一个 shape 为 [1,2,3] 的 tensor
torch.Tensor([ 1, 2, 3]) # 生成一个值为 [1,2,3] 的 tensor

猜你喜欢

转载自blog.csdn.net/zouxiaolv/article/details/80934222