class_docstr: Creates multi-class confusion matrix at thresholds from standard inputs.
class_docstr_tok: ["Creates","multi-class","confusion","matrix","at","thresholds","from","standard","inputs","."]
code: def merge_accumulators(
      self, accumulators: Iterable[Matrices]
  ) -> Matrices:
      accumulators = iter(accumulators)
      result = next(accumulators)
      for accumulator in accumulators:
          for threshold, matrix in accumulator.items():
              if threshold not in result:
                  result[threshold] = {}
              for k, v in matrix.items():
                  if k in result[threshold]:
                      result[threshold][k] += v
                  else:
                      result[threshold][k] = v
      return result
  
imports: from typing import Any, Callable, Dict, Iterable, Iterator, List, NamedTuple, Optional, Tuple
  import apache_beam
  import numpy
  from tensorflow_model_analysis.api import types
  from tensorflow_model_analysis.metrics import metric_types
  from tensorflow_model_analysis.metrics import metric_util
  from tensorflow_model_analysis.proto import config_pb2
  from tensorflow_model_analysis.proto import metrics_for_slice_pb2
label_desc: Use image node_id 4 for calling the _MultiClassConfusionMatrixCombiner obj's underlying member method code with example usage: obj.merge_accumulators(accumulators) and returns: result