Hi,
The problem is at this line: gates = F.linear(input, w_ih, b_ih) + F.linear(hx, w_hh, b_hh).
In one of these operation, some tensors are on the gpu and some are not.
You can use the input.is_cuda flag to check that easily.