def get_batch(self, train_data, bptt, evaluation=False):
     data, target = bptt
     data = data.to(device)
     target = target.to(device)
     if evaluation:
         data.requires_grad_(False)
         target.requires_grad_(False)
     return data, target
 def get_batch(self, train_data, bptt, evaluation=False):
     data, target = bptt
     data = data.float().cuda()
     target = target.long().cuda()
     if evaluation:
         data.requires_grad_(False)
         target.requires_grad_(False)
     return data, target