Hi
I’m training an RNN with LSTM cell. It works when I run the model on CPU, but when I load the model and the data on GPU like:

seq = Sequence()
seq.cuda()
input = Variable(torch.from_numpy(data).cuda())
out = seq(input)

and then I get the error:

TypeError: addmm_ received an invalid combination of arguments - got (int, int, torch.FloatTensor,
torch.cuda.FloatTensor), but expected one of:

(torch.FloatTensor mat1, torch.FloatTensor mat2)
(torch.SparseFloatTensor mat1, torch.FloatTensor mat2)
(float beta, torch.FloatTensor mat1, torch.FloatTensor mat2)
(float alpha, torch.FloatTensor mat1, torch.FloatTensor mat2)
(float beta, torch.SparseFloatTensor mat1, torch.FloatTensor mat2)
(float alpha, torch.SparseFloatTensor mat1, torch.FloatTensor mat2)
(float beta, float alpha, torch.FloatTensor mat1, torch.FloatTensor mat2)
didn’t match because some of the arguments have invalid types: (int, int, torch.FloatTensor, !torch.cuda.FloatTensor!)
(float beta, float alpha, torch.SparseFloatTensor mat1, torch.FloatTensor mat2)
didn’t match because some of the arguments have invalid types: (int, int, !torch.FloatTensor!, !torch.cuda.FloatTensor!)


It seems like the input is not on GPU, but when I output the variable the datatype is

[torch.cuda.DoubleTensor of size 7x6 (GPU 0)]

So how can I fix the problem?
Thank you.