class_docstr: Aggregates metrics using keras model.evaluate method.
class_docstr_tok: ["Aggregates","metrics","using","keras","model.evaluate","method","."]
code: def _add_input(
      self,
      accumulator: tf_metric_accumulators.TFMetricsAccumulator,
      element: metric_types.StandardMetricInputs,
  ) -> tf_metric_accumulators.TFMetricsAccumulator:
      for i, output_name in enumerate(self._output_names):
          if not output_name and len(self._output_names) > 1:
              # The first output_name for multi-output models is '' and is used to
              # store combined metric weights for all outputs, but is not for labels
              # and example weights.
              labels, example_weights = None, None
          else:
              labels, _, example_weights = next(
                  metric_util.to_label_prediction_example_weight(
                      element,
                      self._eval_config,
                      self._model_name,
                      output_name,
                      flatten=False,
                      example_weighted=True,
                  )
              )
  
          if i == 0:
              if element.transformed_features:
                  features = {}
                  features.update(element.features)
                  features.update(element.transformed_features)
              else:
                  features = element.features
          else:
              features = None
          accumulator.add_input(i, features, labels, example_weights)
  
      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 4 for calling the _KerasEvaluateCombiner obj's underlying member method code with example usage: obj._add_input(accumulator, element) and returns: accumulator