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 _process_batch(
      self, accumulator: tf_metric_accumulators.TFMetricsAccumulator
  ):
      if accumulator.len_inputs() == 0:
          return
      self._batch_size_beam_metric_dist.update(accumulator.len_inputs())
      self._total_input_byte_size_beam_metric_dist.update(
          accumulator.get_size_estimate()
      )
      for metric_index, metric in enumerate(self._metrics()):
          metric.reset_states()
      self._update_state(accumulator)
      # For metrics stored with the model, the outputs get encoded in the
      # metric names so we will use a single output for the weights and parse the
      # names at the end to separate metrics by output.
      for metric_index, metric in enumerate(self._metrics()):
          accumulator.add_weights(0, metric_index, metric.get_weights())
      accumulator.clear_inputs()
  
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 7 for calling the _KerasCombiner obj's underlying member method code with example usage: obj._process_batch(accumulator) without return types