(x, on_cpu=False, gpu_id=None, async=False)
return x
Tensor => Variable
Tensor => Variable
Tensor = > Variable
def to_var(x, on_cpu=False, gpu_id=None, async=False):
    """Tensor => Variable"""
    if torch.cuda.is_available() and not on_cpu:
        x = x.cuda(gpu_id, async)
        #x = Variable(x)
    return x
def to_var ( x , on_cpu = False , gpu_id = None , async = False ) : if torch . cuda . is_available ( ) and not on_cpu : x = x . cuda ( gpu_id , async ) #x = Variable(x) return x