class_docstr: Computes example count.
class_docstr_tok: ["Computes","example","count","."]
code: def add_input(
      self,
      accumulator: float,
      element: metric_types.StandardMetricInputs,
  ) -> float:
      if not self._example_weighted or element.example_weight is None:
          example_weight = np.array(1.0)
      else:
          example_weight = element.example_weight
      if isinstance(example_weight, dict) and self._model_name:
          value = util.get_by_keys(
              example_weight, [self._model_name], optional=True
          )
          if value is not None:
              example_weight = value
      if isinstance(example_weight, dict) and self._output_name:
          example_weight = util.get_by_keys(
              example_weight, [self._output_name], np.array(1.0)
          )
      if isinstance(example_weight, dict):
          raise ValueError(
              f"example_count cannot be calculated on a dict {example_weight}: "
              f"model_name={self._model_name}, output_name={self._output_name}.\n\n"
              "This is most likely a configuration error (for multi-output models"
              "a separate metric is needed for each output)."
          )
      return accumulator + np.sum(example_weight)
  
file_path: model-analysis/tensorflow_model_analysis/metrics/example_count.py
imports: from typing import Optional, Dict, Iterable, List
  import apache_beam
  import numpy
  from tensorflow_model_analysis import constants
  from tensorflow_model_analysis.metrics import metric_types
  from tensorflow_model_analysis.utils import util
label_desc: Use image node_id 3 for calling the _ExampleCountCombiner obj's underlying member method code with example usage: obj.add_input(accumulator, element) and returns: unknown