code: def test_labels_and_logits_metrics(self):
      head = ranking_head.create_ranking_head(loss_fn=_make_loss_fn())
      with tf.Graph().as_default():
          logits = [[1.0, 3.0, 2.0], [1.0, 2.0, 3.0]]
          labels = [[0.0, 0.0, 1.0], [0.0, 0.0, 2.0]]
          metrics_dict = head._labels_and_logits_metrics(labels, logits)
          self.assertCountEqual(
              ["labels_mean", "logits_mean"], metrics_dict
          )
          with self.cached_session() as sess:
              sess.run(tf.compat.v1.local_variables_initializer())
              for (metric_op, update_op), value in [
                  (metrics_dict["labels_mean"], 0.5),
                  (metrics_dict["logits_mean"], 2.0),
              ]:
                  sess.run(update_op)
                  self.assertAlmostEqual(
                      sess.run(metric_op), value, places=5
                  )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import tensorflow
  from tensorflow import estimator
  from tensorflow_ranking.python import head
  from tensorflow_ranking.python import metrics
label_desc: Use image node_id 3 for calling the RankingHeadTest obj's underlying member method code with example usage: obj.test_labels_and_logits_metrics() without return types