class_docstr: A combiner which computes cross entropy metrics.
  
  Two importnat parameters for cross entropy calcualtion.
    from_logits: (Optional) Whether output is expected to be a logits tensor.
      By default, we consider that output encodes a probability distribution.
    label_smoothing: Float in [0, 1]. If > `0` then smooth the labels. For
      example, if `0.1`, use `0.1 / num_classes` for non-target labels and
      `0.9 + 0.1 / num_classes` for target labels.
code: def add_input(
      self,
      accumulator: _CrossEntropyAccumulator,
      element: metric_types.StandardMetricInputs,
  ) -> _CrossEntropyAccumulator:
      lpe_iterator = metric_util.to_label_prediction_example_weight(
          element,
          eval_config=self._eval_config,
          model_name=self._metric_key.model_name,
          output_name=self._metric_key.output_name,
          aggregation_type=self._aggregation_type,
          class_weights=self._class_weights,
          example_weighted=self._example_weighted,
          sub_key=self._metric_key.sub_key,
          flatten=False,
      )
      for label, prediction, example_weight in lpe_iterator:
          # The np.item method makes sure the result is a one element numpy array
          # and returns the single element as a float.
          accumulator.total_cross_entropy += self._cross_entropy(
              label, prediction
          ) * metric_util.safe_to_scalar(example_weight)
          accumulator.total_example_weights += (
              metric_util.safe_to_scalar(example_weight)
          )
  
      return accumulator
  
imports: import abc
  import dataclasses
  from typing import Iterable, Optional, Dict
  import apache_beam
  import numpy
  from tensorflow_model_analysis.metrics import metric_types
  from tensorflow_model_analysis.metrics import metric_util
  from tensorflow_model_analysis.proto import config_pb2
label_desc: Use image node_id 4 for calling the _CrossEntropyCombiner obj's underlying member method code with example usage: obj.add_input(accumulator, element) and returns: accumulator