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.
docstr: Returns the cross entropy between the label and prediction.
  
  Subclasses must override this method. Preditctions should encode the
  probability distribution. The output of cross entropy is a numpy array.
  
  Args:
    label: The numpy array of floats. It should be the class probabilities
    prediction: The numpy array of floats. It should be probabilities or
      logits.
docstr_tok: ["Returns","the","cross","entropy","between","the","label","and","prediction",".","Subclasses","must","override","this","method",".","Preditctions","should","encode","the","probability","distribution",".","The","output","of","cross","entropy","is","a","numpy","array",".","Args",":","label",":","The","numpy","array","of","floats",".","It","should","be","the","class","probabilities","prediction",":","The","numpy","array","of","floats",".","It","should","be","probabilities","or","logits","."]
code: def _cross_entropy(self, label, prediction) -> float:
      """Returns the cross entropy between the label and prediction.
  
      Subclasses must override this method. Preditctions should encode the
      probability distribution. The output of cross entropy is a numpy array.
  
      Args:
        label: The numpy array of floats. It should be the class probabilities
        prediction: The numpy array of floats. It should be probabilities or
          logits.
      """
      raise NotImplementedError("Must be implemented in subclasses.")
  
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 2 for calling the _CrossEntropyCombiner obj's underlying member method code with example usage: obj._cross_entropy(label, prediction) without return types