code: def to_numpy(x):
      if isinstance(x, torch.Tensor):
          return x.cpu().detach().numpy()
      if isinstance(x, np.ndarray):
          return x
      if isinstance(x, float):
          return np.array(x)
      raise ValueError(f"Unexpected type {type(x)}")
  
file_path: summarize-from-feedback/summarize_from_feedback/utils/torch_utils.py
imports: import numpy
  import torch
  import torch.nn.functional
label_desc: Use image node_id 1 for calling a global function with example usage: to_numpy(x) and returns: x, x, np