def prepare(self, *args):
    device = torch.device(('cpu' if self.args.cpu else 'cuda'))

    def _prepare(tensor):
        if (self.args.precision == 'half'):
            tensor = tensor.half()
        return tensor.to(device)
    return [_prepare(a) for a in args]
def prepare(self, *args):
    device = torch.device(('cpu' if self.args.cpu else 'cuda'))

    def _prepare(tensor):
        if (self.args.precision == 'half'):
            tensor = tensor.half()
        return tensor.to(device)
    return [_prepare(a) for a in args]