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)
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)
def wrapper(*args, **kwargs): if isClass(args[0]): returned = f(args[0], *Tensor(*args[1:]), **kwargs) else: returned = f(*Tensor(*args), **kwargs) return returned