code: def convert_func_to_numpy(func, shape, device, dtype):
      def np_func(t, y):
          t = torch.tensor(t).to(device, dtype)
          y = torch.reshape(torch.tensor(y).to(device, dtype), shape)
          with torch.no_grad():
              f = func(t, y)
          return f.detach().cpu().numpy().reshape(-1)
  
      return np_func
  
file_path: torchdiffeq/torchdiffeq/_impl/scipy_wrapper.py
imports: import abc
  import torch
  from scipy.integrate import solve_ivp
  from .misc import _handle_unused_kwargs
label_desc: Use image node_id 1 for calling a global function with example usage: convert_func_to_numpy(func, shape, device, dtype) and returns: np_func, f