docstr: Aggregates a batch of output data (predictions, scores, targets/true labels
  and loss).
  
  Args:
      n_batches (int): number of current batch
      preds (torch.Tensor): predictions of current batch
      targets (torch.Tensor): targets of current batch
      scores (torch.Tensor): scores of current batch
      loss (double): average loss of current batch
      m_input (Tuple[torch.Tensor, ...]): model inputs of current batch
      context (Dict[str, Any]): any additional context data, it could be
          either a list of data which maps to each example, or a single value
          for the batch
code: def add_batch_stats(
      self, n_batches, preds, targets, scores, loss, m_input, **context
  ):
      """
      Aggregates a batch of output data (predictions, scores, targets/true labels
      and loss).
  
      Args:
          n_batches (int): number of current batch
          preds (torch.Tensor): predictions of current batch
          targets (torch.Tensor): targets of current batch
          scores (torch.Tensor): scores of current batch
          loss (double): average loss of current batch
          m_input (Tuple[torch.Tensor, ...]): model inputs of current batch
          context (Dict[str, Any]): any additional context data, it could be
              either a list of data which maps to each example, or a single value
              for the batch
      """
      super().add_batch_stats(
          n_batches, preds, targets, scores, loss, m_input, **context
      )
      self.aggregate_topkpreds(scores, context)
  
imports: from enum import Enum
  from itertools import tee, zip_longest
  from typing import Generator, List, Optional, Sequence
  import torch
  from pytext.common.constants import Stage
  from pytext.data import CommonMetadata
  from pytext.metrics import ClassificationMetrics, compute_classification_metrics, compute_multi_label_classification_metrics, LabelListPrediction, LabelPrediction, LabelTopKPrediction, RECALL_AT_PRECISION_THRESHOLDS, safe_division
  from pytext.metrics.intent_slot_metrics import PerLabelConfusions
  from .channel import Channel, ConsoleChannel, FileChannel
  from .metric_reporter import MetricReporter
label_desc: Use image node_id 3 for calling the TopKClassificationMetricReporter obj's underlying member method code with example usage: obj.add_batch_stats(n_batches, preds, targets, scores, loss, m_input) without return types