code: def has_tensor(obj) -> bool:
      
      if isinstance(obj, torch.Tensor):
          return True
      elif isinstance(obj, dict):
          return any(has_tensor(value) for value in obj.values())
      elif isinstance(obj, (list, tuple)):
          return any(has_tensor(item) for item in obj)
      else:
          return False
docs: Given a possibly complex data structure,
      check if it has any torch.Tensors in it.