code: def _list_mle_loss(
      labels,
      logits,
      weights=None,
      lambda_weight=None,
      reduction=tf.compat.v1.losses.Reduction.SUM_BY_NONZERO_WEIGHTS,
      name=None,
  ):
      """Computes the ListMLE loss in (Xia et al 2008) for a list.
  
      Given the labels of graded relevance l_i and the logits s_i, we calculate
      the ListMLE loss for the given list.
  
      The `lambda_weight` re-weights examples based on l_i and r_i.
      The recommended weighting scheme is the formulation presented in the
      "Position-Aware ListMLE" paper (Lan et al.) and available using
      create_p_list_mle_lambda_weight() factory function above.
  
      Args:
        labels: A `Tensor` of the same shape as `logits` representing graded
          relevance.
        logits: A `Tensor` with shape [batch_size, list_size]. Each value is the
          ranking score of the corresponding item.
        weights: A scalar, a `Tensor` with shape [batch_size, 1] for list-wise
          weights, or a `Tensor` with shape [batch_size, list_size] for item-wise
          weights.
        lambda_weight: A `DCGLambdaWeight` instance.
        reduction: One of `tf.losses.Reduction` except `NONE`. Describes how to
          reduce training loss over batch.
        name: A string used as the name for this loss.
  
      Returns:
        An op for the ListMLE loss.
      """
      loss = losses_impl.ListMLELoss(name, lambda_weight)
      with tf.compat.v1.name_scope(
          loss.name, "list_mle_loss", (labels, logits, weights)
      ):
          return loss.compute(labels, logits, weights, reduction)
  
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 16 for calling a global function with example usage: _list_mle_loss(labels, logits, weights, lambda_weight, reduction, name) and returns: loss