Check CUDA status
if torch.cuda.is_available():
print("CUDA is READY")
Model
model = Seq2Seq()
model.cuda(0)
Variable
hidden = Variable(torch.zeros(1, 1, n_hidden)) # Previous
hidden = Variable(torch.zeros(1, 1, n_hidden)).cuda() # Now
Input & Output Tensor
input_batch, output_batch, target_batch = make_batch(seq_data)
input_batch=input_batch.cuda()
output_batch=output_batch.cuda()
target_batch=target_batch.cuda()