class_docstr: Composition of multiple `_RankingHead.
  
  The main functionality is to create an estimator spec that
    - merges all predictions from all heads.
    - merges all eval metrics from all heads.
    - combines all the losses using weights from all heads.
class_docstr_tok: ["Composition","of","multiple","`","_RankingHead",".","The","main","functionality","is","to","create","an","estimator","spec","that","-","merges","all","predictions","from","all","heads",".","-","merges","all","eval","metrics","from","all","heads",".","-","combines","all","the","losses","using","weights","from","all","heads","."]
docstr: Validates the keys of logits and labels.
docstr_tok: ["Validates","the","keys","of","logits","and","labels","."]
code: def _check_logits_and_labels(self, logits, labels=None):
      """Validates the keys of logits and labels."""
      head_names = []
      for head in self._heads:
          head_names.append(head.name)
  
      if len(head_names) != len(set(head_names)):
          raise ValueError("Duplicated names in heads.")
  
      # Check the logits keys.
      if not isinstance(logits, dict):
          raise ValueError(
              "logits in _MultiRankingHead should be a dict."
          )
      logits_missing_names = list(set(head_names) - set(list(logits)))
      if logits_missing_names:
          raise ValueError(
              "logits has missing values for head(s): {}.".format(
                  logits_missing_names
              )
          )
  
      # Check the labels keys.
      if labels is not None:
          if not isinstance(labels, dict):
              raise ValueError(
                  "labels in _MultiRankingHead should be a dict."
              )
          labels_missing_names = list(
              set(head_names) - set(list(labels))
          )
          if labels_missing_names:
              raise ValueError(
                  "labels has missing values for head(s): {}.".format(
                      labels_missing_names
                  )
              )
  
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 3 for calling the _MultiRankingHead obj's underlying member method code with example usage: obj._check_logits_and_labels(logits, labels) without return types