class_docstr: Abstraction for a graph that is used for computing and aggregating metrics.
  
  This abstract class contains methods and lays out the API to handle metrics
  computation and aggregation as part of the TFMA flow. Inheritors of this class
  are responsible for setting up the metrics graph and setting the class
  variables which are required to do metric calculations.
class_docstr_tok: ["Abstraction","for","a","graph","that","is","used","for","computing","and","aggregating","metrics",".","This","abstract","class","contains","methods","and","lays","out","the","API","to","handle","metrics","computation","and","aggregation","as","part","of","the","TFMA","flow",".","Inheritors","of","this","class","are","responsible","for","setting","up","the","metrics","graph","and","setting","the","class","variables","which","are","required","to","do","metric","calculations","."]
docstr: Register additional metric callbacks.
  
  Runs the given list of callbacks for adding additional metrics to the graph.
  
  For more details about add_metrics_callbacks, see the docstring for
  EvalSharedModel.add_metrics_callbacks in types.py.
  
  Args:
    add_metrics_callbacks: A list of metric callbacks to add to the metrics
      graph.
  
  Raises:
    ValueError: There was a metric name conflict: a callback tried to add a
      metric whose name conflicted with a metric that was added by an earlier
      callback.
docstr_tok: ["Register","additional","metric","callbacks",".","Runs","the","given","list","of","callbacks","for","adding","additional","metrics","to","the","graph",".","For","more","details","about","add_metrics_callbacks",",","see","the","docstring","for","EvalSharedModel.add_metrics_callbacks","in","types.py",".","Args",":","add_metrics_callbacks",":","A","list","of","metric","callbacks","to","add","to","the","metrics","graph",".","Raises",":","ValueError",":","There","was","a","metric","name","conflict",":","a","callback","tried","to","add","a","metric","whose","name","conflicted","with","a","metric","that","was","added","by","an","earlier","callback","."]
code: def register_add_metric_callbacks(
      self, add_metrics_callbacks: List[types.AddMetricsCallbackType]
  ) -> None:
      """Register additional metric callbacks.
  
      Runs the given list of callbacks for adding additional metrics to the graph.
  
      For more details about add_metrics_callbacks, see the docstring for
      EvalSharedModel.add_metrics_callbacks in types.py.
  
      Args:
        add_metrics_callbacks: A list of metric callbacks to add to the metrics
          graph.
  
      Raises:
        ValueError: There was a metric name conflict: a callback tried to add a
          metric whose name conflicted with a metric that was added by an earlier
          callback.
  
      """
      with self._graph.as_default():
          (
              features_dict,
              predictions_dict,
              labels_dict,
          ) = self.get_features_predictions_labels_dicts()
          features_dict = (
              util.wrap_tensor_or_dict_of_tensors_in_identity(
                  features_dict
              )
          )
          predictions_dict = (
              util.wrap_tensor_or_dict_of_tensors_in_identity(
                  predictions_dict
              )
          )
          labels_dict = util.wrap_tensor_or_dict_of_tensors_in_identity(
              labels_dict
          )
  
          metric_ops = {}
          for add_metrics_callback in add_metrics_callbacks:
              new_metric_ops = add_metrics_callback(
                  features_dict, predictions_dict, labels_dict
              )
              overlap = set(new_metric_ops) & set(metric_ops)
              if overlap:
                  raise ValueError(
                      "metric keys should not conflict, but an "
                      "earlier callback already added the metrics "
                      "named %s" % overlap
                  )
              metric_ops.update(new_metric_ops)
          self.register_additional_metric_ops(metric_ops)
  
imports: import abc
  import itertools
  import threading
  from typing import Any, Dict, List, NamedTuple, Tuple
  import apache_beam
  import tensorflow
  from tensorflow_model_analysis import constants
  from tensorflow_model_analysis.api import types
  from tensorflow_model_analysis.eval_saved_model import constants
  from tensorflow_model_analysis.eval_saved_model import util
  from tensorflow_model_analysis.utils import util
label_desc: Use image node_id 3 for calling the EvalMetricsGraph obj's underlying member method code with example usage: obj.register_add_metric_callbacks(add_metrics_callbacks) without return types