code: def get_tensors(object_):
      
      if torch.is_tensor(object_):
          return [object_]
      elif isinstance(object_, (str, float, int)):
          return []
  
      tensors = set()
  
      if isinstance(object_, collections.abc.Mapping):
          for value in object_.values():
              tensors.update(get_tensors(value))
      elif isinstance(object_, collections.abc.Iterable):
          for value in object_:
              tensors.update(get_tensors(value))
      else:
          members = [
              value for key, value in inspect.getmembers(object_)
              if not isinstance(value, (collections.abc.Callable, type(None)))
          ]
          tensors.update(get_tensors(members))
  
      return tensors
docs: Get all tensors associated with ``object_``
  
      Args:
          object_ (any): Any object to look for tensors.
  
      Returns:
          (list of torch.tensor): List of tensors that are associated with ``object_``.