I have a bit of confusion here.
Can I create a variable at run-time and call .cuda on it while working on multiple GPUS.

Screen Shot 2017-11-12 at 2.02.34 PM.png2360×1442 500 KB

For the above code to work on multi GPU

I need to call h_0.cuda(), c_0.cuda() in the forward function?
Can I just call .cuda() on the wcembeds variable which is created during run-time and expect it to work?

From the above discussion my lengths tensor which is not a variable should not be converted to .cuda(). This means
3. inputs —> inputs.cuda()
4. lengths --> lengths #no cuda transformation?

Screen Shot 2017-11-09 at 10.39.46 PM.png1374×420 49.5 KB

5. Do I need to convert my original_indices tensor to .cuda()?
Sorry, for being very naive. I will have to spend some time understanding how stuff works on GPU, but, for the time-being could you guys help?