我得到了一维IntTensor,但我想将其转换为整数。我通过这种方法尝试:
print(dictionary[IntTensor.int()])
但出现错误:
KeyError: Variable containing: 423 [torch.IntTensor of size 1]
谢谢〜
pytorch tensor
pytorch ×1
tensor ×1