code: def _validate_outputs(outputs: Any, func: Callable) -> None:
      if isinstance(outputs, Tensor):
          return
      if not isinstance(outputs, tuple):
          raise ValueError(
              f"vmap({_get_name(func)}, ...): `{_get_name(func)}` must only return "
              f"Tensors, got type {type(outputs)} as the return."
          )
      for idx, output in enumerate(outputs):
          if isinstance(output, Tensor):
              continue
          raise ValueError(
              f"vmap({_get_name(func)}, ...): `{_get_name(func)}` must only return "
              f"Tensors, got type {type(output)} for return {idx}."
          )
  
file_path: pytorch/torch/_vmap_internals.py
imports: import functools
  import warnings
  from typing import Any, Callable, List, Optional, Tuple, Union
  import torch
  from torch import Tensor
  from torch.utils._pytree import _broadcast_to_and_flatten, tree_flatten, tree_unflatten
label_desc: Use image node_id 6 for calling a global function with example usage: _validate_outputs(outputs, func) without return types