class_docstr: Computes binary confusion matrix.
docstr: Adds a batch of inputs to the accumulator.
  
  Args:
    accumulator: Accumulator to add input to.
    labels: Expected values.
    predictions: Predicted values.
    example_weights: Weights for each example.
    example_ids: IDs For each example.
  
  Returns:
    Merged MatrixAccumulator of the original accumulator and the added inputs.
code: def add_inputs(
      self,
      accumulator: MatrixAccumulator,
      labels: Sequence[Sequence[float]],
      predictions: Sequence[Sequence[float]],
      example_weights: Optional[Sequence[Sequence[float]]],
      example_ids: Optional[Sequence[str]],
  ) -> MatrixAccumulator:
      """Adds a batch of inputs to the accumulator.
  
      Args:
        accumulator: Accumulator to add input to.
        labels: Expected values.
        predictions: Predicted values.
        example_weights: Weights for each example.
        example_ids: IDs For each example.
  
      Returns:
        Merged MatrixAccumulator of the original accumulator and the added inputs.
      """
      make_iter = lambda ex: ex if hasattr(ex, "__iter__") else [ex]
  
      if example_weights is None:
          example_weights = [None] * len(labels)
  
      if example_ids is None:
          example_ids = [None] * len(labels)
  
      for label, prediction, example_weight, example_id in zip(
          labels, predictions, example_weights, example_ids
      ):
          # Calls self.add_input() for each example within the batch.
          accumulator = self.add_input(
              accumulator=accumulator,
              labels=make_iter(label),
              predictions=make_iter(prediction),
              example_weights=make_iter(example_weight),
              example_id=example_id,
          )
  
      return accumulator
  
file_path: model-analysis/tensorflow_model_analysis/contrib/aggregates/binary_confusion_matrices.py
imports: from typing import Dict, Iterable, List, NamedTuple, Optional, Sequence
  from tensorflow_model_analysis.experimental.lazytf import api
label_desc: Use image node_id 6 for calling the BinaryConfusionMatrices obj's underlying member method code with example usage: obj.add_inputs(accumulator, labels, predictions, example_weights, example_ids) and returns: accumulator