Solved by a_d in post #2 
              
              
                As the error suggests, both your model and your input to the model should lie on the same device either the CPU or the GPU. Therefore once you shift the model to gpu, shift your input tensors too. Also, I suggest to not use the Variable  API as it’s an old API. Not using the Variable  would do too. 
…