code: def _neural_sort_cross_entropy_loss(
      labels,
      logits,
      weights=None,
      reduction=tf.compat.v1.losses.Reduction.SUM,
      name=None,
      temperature=1.0,
  ):
      """Computes NeuralSort CrossEntropy loss.
  
      NeuralSort CrossEntropy computes the cross entropy of the permutation
      matrix approximations between the one computed from labels and the one
      computed from the logits.
  
      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. If None, the weight of a list in the mini-batch is set to the sum
          of the labels of the items in that list.
        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.
        temperature: The temperature used to scale logits=logits/temperature.
  
      Returns:
        An op for the NeuralSort CrossEntropy loss.
      """
      loss = losses_impl.NeuralSortCrossEntropyLoss(
          name, temperature=temperature
      )
      with tf.compat.v1.name_scope(
          loss.name,
          "neural_sort_cross_entropy_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 19 for calling a global function with example usage: _neural_sort_cross_entropy_loss(labels, logits, weights, reduction, name, temperature) and returns: loss