code: def pytorch_wrapper(func):
      def wrapped_func(x):
          x_numpy = x.cpu().data.numpy()
          output = func(x_numpy)
          output = torch.from_numpy(output)
          output = output.to(x.device)
  
          return output
  
      return wrapped_func
  
file_path: advertorch/advertorch/attacks/blackbox/utils.py
imports: from math import inf
  from operator import mul
  from functools import reduce
  import numpy
  import torch
  from advertorch.utils import batch_clamp
label_desc: Use image node_id 1 for calling a global function with example usage: pytorch_wrapper(func) and returns: wrapped_func, output