pycharm查看全部tensor数据,取消省略

方法一

<tensor>.cpu().numpy()

在这里插入图片描述
把tensor转为ndarray
然后点击say as array
pycharm查看全部tensor数据,取消省略_第1张图片

方法二

torch.set_printoptions(profile="full")
print(x) # prints the whole tensor
torch.set_printoptions(profile="default") # reset
print(x) # prints the truncated tensor

你可能感兴趣的:(python,pycharm)