code: def result_to_backend_type(result):
      """Convert np.array to gs.array within result object."""
      if gs.__name__.endswith("numpy") or gs.__name__.endswith(
          "autograd"
      ):
          return result
  
      for key, value in result.items():
          if type(value) is np.ndarray:
              result[key] = gs.from_numpy(value)
  
          if isinstance(value, PPoly):
              new_ppoly = _InstanceConvertOutputWrapper(value)
              result[key] = new_ppoly
  
      return result
  
file_path: geomstats/geomstats/numerics/_common.py
imports: import functools
  from types import MethodType
  import numpy
  from scipy.interpolate import PPoly
  import geomstats.backend
label_desc: Use image node_id 1 for calling a global function with example usage: result_to_backend_type(result) and returns: result, result