class_docstr: This class simply wraps over a given a set of SummarizerSingleTensor's in order
  to summarise multiple input tensors.
  
  Basic usage:
  
  >>>from captum.attr.aggregator import Summarizer
  >>>from captum.attr._utils.stats import Mean, StdDev
  >>>
  >>>attrib = torch.tensor([1, 2, 3, 4, 5])
  >>>
  >>>summ = Summarizer([Mean(), StdDev(0])
  >>>summ.update(attrib)
  >>>
  >>>print(summ.summary['mean'])
docstr: Calls `update` on each `Stat` object within the summarizer
  
  Args:
      x (Tensor or Tuple[Tensor, ...]):
          The input(s) you wish to summarize
docstr_tok: ["Calls","`","update","`","on","each","`","Stat","`","object","within","the","summarizer","Args",":","x","(","Tensor","or","Tuple","[","Tensor",",","...","]",")",":","The","input","(","s",")","you","wish","to","summarize"]
code: def update(
      self, x: Union[float, Tensor, Tuple[Union[float, Tensor], ...]]
  ):
      r"""
      Calls `update` on each `Stat` object within the summarizer
  
      Args:
          x (Tensor or Tuple[Tensor, ...]):
              The input(s) you wish to summarize
      """
      if self._is_inputs_tuple is None:
          self._is_inputs_tuple = isinstance(x, tuple)
      else:
          # we want input to be consistently a single input or a tuple
          assert not (self._is_inputs_tuple ^ isinstance(x, tuple))
  
      from captum._utils.common import (
          _format_float_or_tensor_into_tuples,
      )
  
      x = _format_float_or_tensor_into_tuples(x)
  
      for i, inp in enumerate(x):
          if i >= len(self._summarizers):
              # _summarizers[i] is a new SummarizerSingleTensor, which
              # aims to summarize input i (i.e. x[i])
              #
              # Thus, we must copy our stats, as otherwise
              # in the best case the statistics for each input will be mangled
              # and in the worst case we will run into an error due to different
              # dimensionality in the input tensors tensors (i.e.
              # x[i].shape != x[j].shape for some pair i, j)
              stats = self._copy_stats()
              self._summarizers.append(
                  SummarizerSingleTensor(
                      stats=stats,
                      summary_stats_indices=self._summary_stats_indicies,
                  )
              )
          if not isinstance(inp, torch.Tensor):
              inp = torch.tensor(inp, dtype=torch.float)
          self._summarizers[i].update(inp)
  
file_path: captum/captum/attr/_utils/summarizer.py
imports: from typing import Dict, List, Optional, Tuple, Type, Union
  import torch
  from captum.attr._utils.stat import Count, Max, Mean, Min, MSE, Stat, StdDev, Sum, Var
  from captum.log import log_usage
  from torch import Tensor
label_desc: Use image node_id 3 for calling the Summarizer obj's underlying member method code with example usage: obj.update(x) without return types