How to cast a 1-d IntTensor to int in Pytorch
How do I convert a 1-D IntTensor to an integer? This:
IntTensor.int()

Gives an error:
KeyError: Variable containing:
 423
[torch.IntTensor of size 1]


You can use:

print(dictionary[IntTensor.data[0]])

The key you're using is an object of type autograd.Variable.
.data gives the tensor and the index 0 can be used to access the element.
