code: def kendalls_tau(y_true, y_pred, name=None):
      """Computes Kendall's Tau for two ordered lists.
  
      Kendall's Tau measures the correlation between ordinal rankings.
      The provided values may be of any type that is sortable, with the
      argsort indices indicating the true or proposed ordinal sequence.
  
      Args:
        y_true: a `Tensor` of shape `[n]` containing the true ordinal ranking.
        y_pred: a `Tensor` of shape `[n]` containing the predicted ordering of the
          same N items.
        name: Optional Python `str` name for ops created by this method.
          Default value: `None` (i.e., 'kendalls_tau').
  
      Returns:
        kendalls_tau: Kendall's Tau, the 1945 tau-b formulation that ignores
          ordering of ties, as a `float32` scalar Tensor.
      """
      with tf.name_scope(name or "kendalls_tau"):
          in_type = dtype_util.common_dtype(
              [y_true, y_pred], dtype_hint=tf.float32
          )
          y_true = tf.convert_to_tensor(
              y_true, name="y_true", dtype=in_type
          )
          y_pred = tf.convert_to_tensor(
              y_pred, name="y_pred", dtype=in_type
          )
          tensorshape_util.assert_is_compatible_with(
              y_true.shape, y_pred.shape
          )
          assertions = [
              assert_util.assert_rank(y_true, 1),
              assert_util.assert_greater(
                  ps.size(y_true),
                  1,
                  "Ordering requires at least 2 elements.",
              ),
          ]
          with tf.control_dependencies(assertions):
              n = ps.size0(y_true)
              indices = _tril_indices(n)
              dxij = tf.sign(
                  tf.gather(y_true, indices[0])
                  - tf.gather(y_true, indices[1])
              )
              dyij = tf.sign(
                  tf.gather(y_pred, indices[0])
                  - tf.gather(y_pred, indices[1])
              )
              # s is sum of concordant pairs minus discordant pairs.
              s = tf.cast(tf.math.reduce_sum(dxij * dyij), tf.float32)
              # t is the number of y_true pairs that are not ties.
              t = tf.math.count_nonzero(dxij, dtype=tf.float32)
              # u is the number of y_pred pairs that are not ties.
              u = tf.math.count_nonzero(dyij, dtype=tf.float32)
              assertions = [
                  assert_util.assert_positive(
                      t, "All ranks are ties for y_true."
                  ),
                  assert_util.assert_positive(
                      u, "All ranks are ties for y_pred."
                  ),
              ]
              with tf.control_dependencies(assertions):
                  return s / tf.math.sqrt(t * u)
  
imports: import tensorflow.compat.v2
  from tensorflow_probability.python.internal import assert_util
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import tensorshape_util
label_desc: Use image node_id 2 for calling a global function with example usage: kendalls_tau(y_true, y_pred, name) and returns: unknown