class_docstr: Interface for the head/top of a ranking model.
class_docstr_tok: ["Interface","for","the","head\/top","of","a","ranking","model","."]
docstr: Returns metrics for labels and logits.
docstr_tok: ["Returns","metrics","for","labels","and","logits","."]
code: def _labels_and_logits_metrics(self, labels, logits):
      """Returns metrics for labels and logits."""
      is_label_valid = tf.reshape(tf.greater_equal(labels, 0.0), [-1])
      metrics_dict = {}
      for name, tensor in [
          ("labels_mean", labels),
          ("logits_mean", logits),
      ]:
          metrics_dict[name] = tf.compat.v1.metrics.mean(
              tf.boolean_mask(
                  tensor=tf.reshape(tensor, [-1]), mask=is_label_valid
              )
          )
      return metrics_dict
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import abc
  import six
  import tensorflow
  from tensorflow import estimator
label_desc: Use image node_id 4 for calling the _RankingHead obj's underlying member method code with example usage: obj._labels_and_logits_metrics(labels, logits) and returns: metrics_dict