class_docstr: Base combiner for aggregating metrics for keras based models.
class_docstr_tok: ["Base","combiner","for","aggregating","metrics","for","keras","based","models","."]
code: def add_input(
      self,
      accumulator: tf_metric_accumulators.TFMetricsAccumulator,
      element: metric_types.StandardMetricInputs,
  ) -> tf_metric_accumulators.TFMetricsAccumulator:
      accumulator = self._add_input(accumulator, element)
      if accumulator.should_flush():
          self._process_batch(accumulator)
      return accumulator
  
imports: import collections
  from itertools import chain
  from typing import Dict, Iterable, List, Optional
  import apache_beam
  import numpy
  import tensorflow
  from tensorflow_model_analysis import constants
  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.metrics import tf_metric_accumulators
  from tensorflow_model_analysis.proto import config_pb2
  from tensorflow_model_analysis.utils import model_util
  from tensorflow_model_analysis.utils import util
label_desc: Use image node_id 9 for calling the _KerasCombiner obj's underlying member method code with example usage: obj.add_input(accumulator, element) and returns: accumulator