Solved by Ivo_99 in post #23 
              
              
                Dear ptrblck. 
with the combination of: 
torch.set_default_tensor_type(‘torch.cuda.FloatTensor’) 
model.to(device) 
and your suggestion of: 
    def init_hidden(self, batchSize):
        device = next(self.parameters()).device
        return torch.zeros(1, batchSize, hiddenDimSize, device=device)

I…