class_docstr: A wrapper that evaluates multiple metrics simultaneously
  
  Arguments
  ---------
  metric : function
      The function to use to compute the relevant metrics. Should take
      at least two arguments (predictions and targets) and can
      optionally take the relative lengths of either or both arguments.
      The function should return a dict or a namedtuple
  
  batch_eval: bool
      When True it feeds the evaluation metric with the batched input.
      When False and n_jobs=1, it performs metric evaluation one-by-one
      in a sequential way. When False and n_jobs>1, the evaluation
      runs in parallel over the different inputs using joblib.
  n_jobs : int
      The number of jobs to use for computing the metric. If this is
      more than one, every sample is processed individually, otherwise
      the whole batch is passed at once.
  
  Example
  -------
  >>> def metric(a, b):
  ...    return {
  ...        "sum": a + b,
  ...        "diff": a - b,
  ...        "sum_sq": a**2 + b**2
  ...    }
  >>> multi_metric = MultiMetricStats(metric, batch_eval=True)
  >>> multi_metric.append([1, 2], a=torch.tensor([2.0, 1.0]), b=torch.tensor([1.0, 2.0]))
  >>> multi_metric.append([3, 4], a=torch.tensor([4.0, 5.0]), b=torch.tensor([0.0, 1.0]))
  >>> multi_metric.append([5, 6], a=torch.tensor([2.0, 4.0]), b=torch.tensor([4.0, 2.0]))
  >>> multi_metric.append([7, 8], a=torch.tensor([2.0, 4.0]), b=torch.tensor([4.0, 2.0]))
  >>> multi_metric.summarize() #doctest: +NORMALIZE_WHITESPACE
  {'sum': {'average': 5.0,
    'min_score': 3.0,
    'min_id': 1,
    'max_score': 6.0,
    'max_id': 4},
   'diff': {'average': 1.0,
    'min_score': -2.0,
    'min_id': 5,
    'max_score': 4.0,
    'max_id': 3},
   'sum_sq': {'average': 16.5,
    'min_score': 5.0,
    'min_id': 1,
    'max_score': 26.0,
    'max_id': 4}}
  >>> multi_metric.summarize(flat=True) #doctest: +NORMALIZE_WHITESPACE
  {'sum_average': 5.0,
   'sum_min_score': 3.0,
   'sum_min_id': 1,
   'sum_max_score': 6.0,
   'sum_max_id': 4,
   'diff_average': 1.0,
   'diff_min_score': -2.0,
   'diff_min_id': 5,
   'diff_max_score': 4.0,
   'diff_max_id': 3,
   'sum_sq_average': 16.5,
   'sum_sq_min_score': 5.0,
   'sum_sq_min_id': 1,
   'sum_sq_max_score': 26.0,
   'sum_sq_max_id': 4}
code: def __init__(self, metric, n_jobs=1, batch_eval=False):
      self.metric = _dictify(metric)
      self.n_jobs = n_jobs
      self.batch_eval = batch_eval
      self.ids = []
      self.metrics = {}
  
imports: import torch
  from joblib import Parallel, delayed
  from speechbrain.utils.data_utils import undo_padding
  from speechbrain.utils.edit_distance import wer_summary, wer_details_for_batch
  from speechbrain.dataio.dataio import merge_char, split_word, extract_concepts_values
  from speechbrain.dataio.wer import print_wer_summary, print_alignments
label_desc: Use image node_id 1 to create a new MultiMetricStats object  with example: obj = MultiMetricStats(metric, n_jobs, batch_eval)