class_docstr: The loss metric function maker.
docstr: Initializes a loss metric function maker.
  
  Args:
    loss_key: A key in `RankingLossKey`.
    weights_feature_name: A `string` specifying the name of the weights
      feature in `features` dict.
    lambda_weight: A `_LambdaWeight` object.
    name: A `string` used as the name for this metric.
  
  Returns:
    A metric fn with the following Args:
    * `labels`: A `Tensor` of the same shape as `predictions` representing
    graded relevance.
    * `predictions`: A `Tensor` with shape [batch_size, list_size]. Each value
    is the ranking score of the corresponding example.
    * `features`: A dict of `Tensor`s that contains all features.
docstr_tok: ["Initializes","a","loss","metric","function","maker",".","Args",":","loss_key",":","A","key","in","`","RankingLossKey","`",".","weights_feature_name",":","A","`","string","`","specifying","the","name","of","the","weights","feature","in","`","features","`","dict",".","lambda_weight",":","A","`","_LambdaWeight","`","object",".","name",":","A","`","string","`","used","as","the","name","for","this","metric",".","Returns",":","A","metric","fn","with","the","following","Args",":","*","`","labels","`",":","A","`","Tensor","`","of","the","same","shape","as","`","predictions","`","representing","graded","relevance",".","*","`","predictions","`",":","A","`","Tensor","`","with","shape","[","batch_size",",","list_size","]",".","Each","value","is","the","ranking","score","of","the","corresponding","example",".","*","`","features","`",":","A","dict","of","`","Tensor","`","s","that","contains","all","features","."]
code: def __init__(
      self,
      loss_key: str,
      weights_feature_name: Optional[str] = None,
      lambda_weight: Optional[losses_impl._LambdaWeight] = None,
      name: Optional[str] = None,
  ):
      """Initializes a loss metric function maker.
  
      Args:
        loss_key: A key in `RankingLossKey`.
        weights_feature_name: A `string` specifying the name of the weights
          feature in `features` dict.
        lambda_weight: A `_LambdaWeight` object.
        name: A `string` used as the name for this metric.
  
      Returns:
        A metric fn with the following Args:
        * `labels`: A `Tensor` of the same shape as `predictions` representing
        graded relevance.
        * `predictions`: A `Tensor` with shape [batch_size, list_size]. Each value
        is the ranking score of the corresponding example.
        * `features`: A dict of `Tensor`s that contains all features.
      """
      self.loss_key = loss_key
      self.weights_feature_name = weights_feature_name
      self.lambda_weight = lambda_weight
      self.name = name
  
imports: from typing import Any, Callable, Dict, List, Mapping, Optional, Sequence, Tuple, Union
  import tensorflow
  from tensorflow_ranking.python import losses_impl
  from tensorflow_ranking.python import utils
label_desc: Use image node_id 1 to create a new _LossMetricFunctionMaker object from inherited base classes: object with example: obj = _LossMetricFunctionMaker(loss_key, weights_feature_name, lambda_weight, name)