Unable to get repr for <class 'torch.Tensor'> tensor越界访问后就会变成这样。 import torch a_data=torch.Tensor([1,2,3]) index=[0,1,1,2,1] ba=a_data[index] print(ba) labels[[0,5]] 来源:oschina链接:https://my.oschina.net/u/4337191/blog/4428179 标签 torch