Torch 的Tensor与numpy的array会共享储存空间,修改一个也会导致另外一个被修改Tensor转换成Numpy数组a = torch.ones(5)b = a.numpy()a.add_(1)print(a)print(b)将Numpy ...
確定! 回上一頁