Pytorch Tensor help in LongTensor
a=[1,2,3];
context_var = autograd.Variable(torch.LongTensor(a))


This is giving an error

RuntimeError: tried to construct a tensor from a int sequence, but found an item of type numpy.int32 at index


I am not able to figure out how to get over this. 

Your code works perfectly fine in the recent version of pytorch. But for older versions, you can convert the numpy array to list using .tolist() method as follows to get rid of the error.

a=[1,2,3];
context_var = autograd.Variable(torch.LongTensor(a.tolist())) 

