code: def _as_numpy_recursive(x):
      if isinstance(x, torch.Tensor):
          return x.detach().cpu().numpy()
      if isinstance(x, list) or isinstance(x, tuple):
          return np.asarray([_as_numpy_recursive(y) for y in x])
      return x
  
label_desc: Use image node_id 1 for calling a global function with example usage: _as_numpy_recursive(x) and returns: x, x, np