(self, batch)
return batch
Prepare a batch with two functions: cuda_tf and detach_tf (only in eval mode)
Prepare a batch with two functions: cuda_tf and detach_tf (only in eval mode)
Prepare a batch with two functions : cuda_tf and detach_tf ( only in eval mode )
def prepare_batch(self, batch):
        """ Prepare a batch with two functions: cuda_tf and detach_tf (only in eval mode)
        """
        if self.is_cuda:
            batch = self.cuda_tf()(batch)
        if self.mode == 'eval':
            batch = self.detach_tf()(batch)
        return batch
def prepare_batch ( self , batch ) : if self . is_cuda : batch = self . cuda_tf ( ) ( batch ) if self . mode == 'eval' : batch = self . detach_tf ( ) ( batch ) return batch