>>> a = torch.tensor([[1,2,3],[2,3,4],[3,4,5]])
>>> a
tensor([[1, 2, 3],
[2, 3, 4],
[3, 4, 5]])
Если мы преобразуем этот тензор в числовой массив и попытаемся его распечатать, это выдаст ошибку
>>> a = a.numpy()
>>> a
AttributeError: module 'numpy.core.multiarray' has no attribute 'generic'
The above exception was the direct cause of the following exception:
...
--> 794 output = repr(obj)
795 lines = output.splitlines()
796 with p.group():
RuntimeError: Unable to configure default ndarray.__repr__
Подробнее здесь: https://stackoverflow.com/questions/793 ... s-an-error
Мобильная версия