That’s great. Thanks for the suggestion. Just to clarify what you mean by judicious use of tensor.new. I haven’t been able to find any documentation for tensor.new. I’m guessing the general idea is whenever defining a tensor within a Variable to use tensor.new().zeros(x, y) and this will avoid having to use an is_cuda if statement.
As for the data, I’m going to experiment with this myself soon but I thought I’d add a question in for anyone else who comes along. Torchtext and the regular dataloader both create iterators. Can you run .cuda() on the batch iterator or do have to run it on every Variable batch the comes out of the iterator.
There examples in seq2seq tutorial of the encoder and decoder models being cuda’d
EDIT: I just noticed that torchtext does indeed already have a built in option for specifying device when creating the batch iterators