docs: def get_backend(tensor):
      """
      Takes a correct backend (e.g. numpy backend if tensor is numpy.ndarray) for a tensor.
      If needed, imports package and creates backend
      """
      for framework_name, backend in _backends.items():
          if backend.is_appropriate_type(tensor):
              return backend
  
      for BackendSubclass in AbstractBackend.__subclasses__():
          if _debug_importing:
              print('Testing for subclass of ', BackendSubclass)
          if BackendSubclass.framework_name not in _backends:
              # check that module was already imported. Otherwise it can't be imported
              if BackendSubclass.framework_name in sys.modules:
                  if _debug_importing:
                      print('Imported backend for ', BackendSubclass.framework_name)
                  backend = BackendSubclass()
                  _backends[backend.framework_name] = backend
                  if backend.is_appropriate_type(tensor):
                      return backend
  
      raise RuntimeError('Tensor type unknown to einops {}'.format(type(tensor)))