decoder_output, decoder_context, decoder_hidden, decoder_attn = decoder_test(word_inputs[0], decoder_context, decoder_hidden, encoder_outputs)
Are all the arguments you’re sending to decoder_test on the GPU? (You can check by printing them out in an interpreter or doing some_tensor.is_cuda()
Unfortunately there isn’t a global flag you can set to make everything go from CPU to GPU automatically.