code: def describe_outputs(
      outputs: Union[Tensor, Dict[str, Tensor], Iterable[Tensor]]
  ) -> Union[List[Dict], Dict[str, Any]]:
      """
      Describe outputs and return shape, mean & std for each tensor in list or dict (Supports nested tensors)
  
      Args:
          outputs: Input (Usually model outputs)
      Returns:
          Same structure but each item represents tensor shape, mean & std
      """
      if torch.is_tensor(outputs):
          if torch.is_floating_point(outputs):
              desc = dict(
                  size=tuple(outputs.size()),
                  mean=outputs.mean().item(),
                  std=outputs.std().item(),
                  dtype=outputs.dtype,
              )
          else:
              desc = dict(
                  size=tuple(outputs.size()),
                  num_unique=len(torch.unique(outputs)),
                  dtype=outputs.dtype,
              )
      elif isinstance(outputs, collections.abc.Mapping):
          desc = {}
          for key, value in outputs.items():
              desc[key] = describe_outputs(value)
      elif dataclasses.is_dataclass(outputs):
          desc = dataclasses.asdict(outputs)
          for key, value in desc.items():
              desc[key] = describe_outputs(value)
      elif isinstance(outputs, collections.abc.Iterable):
          desc = []
          for index, output in enumerate(outputs):
              desc.append(describe_outputs(output))
      else:
          warnings.warn(
              f"describe_outputs is not implemeted for type {type(outputs)}"
          )
          return str(outputs)
      return desc
  
imports: import collections
  import dataclasses
  import functools
  import warnings
  import logging
  from typing import Optional, Sequence, Union, Dict, List, Any, Iterable, Callable
  import numpy
  import torch
  from torch import nn, Tensor
  from torch.utils.data import Dataset, ConcatDataset
  from torch.utils.data.dataloader import default_collate
  from .support import pytorch_toolbelt_deprecated
label_desc: Use image node_id 24 for calling a global function with example usage: describe_outputs(outputs) and returns: desc, str