class_docstr: Converts a loss function into a metric.
class_docstr_tok: ["Converts","a","loss","function","into","a","metric","."]
code: def update_state(
      self, y_true, y_pred, sample_weight
  ):  # pytype: disable=signature-mismatch  # overriding-parameter-count-checks
      return super().update_state(
          self.loss(y_true, y_pred), sample_weight=sample_weight
      )
  
imports: import collections
  import importlib
  import itertools
  from typing import Any, Dict, Iterable, List, Optional, Type, Tuple, Union
  import apache_beam
  import numpy
  import tensorflow
  from tensorflow_model_analysis import constants
  from tensorflow_model_analysis.metrics import binary_confusion_matrices
  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
label_desc: Use image node_id 2 for calling the _LossMetric obj's underlying member method code with example usage: obj.update_state(y_true, y_pred, sample_weight) and returns: super