示例#1
0
    def wrapper(*args, **kwargs):
        if USE_GPU:
            if isClass(args[0]):
                returned = f(args[0], *Tensors(*args[1:]), **kwargs)
            returned = f(*Tensors(*args), **kwargs)
            return return_torch(returned)

        returned = f(*args, **kwargs)
        return return_numpy(returned)
示例#2
0
    def wrapper(*args, **kwargs):
        if isClass(args[0]):
            returned = f(args[0], *Tensor(*args[1:]), **kwargs)
        else:
            returned = f(*Tensor(*args), **kwargs)

        if not isList(returned):
            returned = [returned]

        return return_numpy(*returned)
示例#3
0
 def wrapper(*args, **kwargs):
     if isClass(args[0]):
         returned = f(args[0], *Tensor(*args[1:]), **kwargs)
     else:
         returned = f(*Tensor(*args), **kwargs)
     return returned