class_docstr: A default class for storing and summarizing arbitrary metrics.
  
  More complex metrics can be created by sub-classing this class.
  
  Arguments
  ---------
  metric : function
      The function to use to compute the relevant metric. Should take
      at least two arguments (predictions and targets) and can
      optionally take the relative lengths of either or both arguments.
      Not usually used in sub-classes.
  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
  -------
  >>> from speechbrain.nnet.losses import l1_loss
  >>> loss_stats = MetricStats(metric=l1_loss)
  >>> loss_stats.append(
  ...      ids=["utterance1", "utterance2"],
  ...      predictions=torch.tensor([[0.1, 0.2], [0.2, 0.3]]),
  ...      targets=torch.tensor([[0.1, 0.2], [0.1, 0.2]]),
  ...      reduction="batch",
  ... )
  >>> stats = loss_stats.summarize()
  >>> stats['average']
  0.050...
  >>> stats['max_score']
  0.100...
  >>> stats['max_id']
  'utterance2'
docstr: Creates empty container for storage, removing existing stats.
docstr_tok: ["Creates","empty","container","for","storage",",","removing","existing","stats","."]
code: def clear(self):
      """Creates empty container for storage, removing existing stats."""
      self.scores = []
      self.ids = []
      self.summary = {}
  
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 2 for calling the MetricStats obj's underlying member method code with example usage: obj.clear() without return types