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: See `_AbstractRankingHead`.
docstr_tok: ["See","`","_AbstractRankingHead","`","."]
code: def create_estimator_spec(
      self,
      features,
      mode,
      logits,
      labels=None,
      regularization_losses=None,
  ):
      """See `_AbstractRankingHead`."""
      with tf.compat.v1.name_scope(self.name, "multi_head"):
          self._check_logits_and_labels(logits, labels)
          # Get all estimator spec.
          all_estimator_spec = []
          for head in self._heads:
              all_estimator_spec.append(
                  head.create_estimator_spec(
                      features=features,
                      mode=mode,
                      logits=logits[head.name],
                      labels=labels[head.name] if labels else None,
                  )
              )
          # Predict.
          if mode == tf_estimator.ModeKeys.PREDICT:
              export_outputs = self._merge_predict_export_outputs(
                  all_estimator_spec
              )
              return tf_estimator.EstimatorSpec(
                  mode=mode,
                  predictions=logits,
                  export_outputs=export_outputs,
              )
  
          # Compute the merged loss and eval metrics.
          loss = self._merge_loss(
              labels, logits, features, mode, regularization_losses
          )
          eval_metric_ops = self._merge_metrics(all_estimator_spec)
  
          # Eval.
          if mode == tf_estimator.ModeKeys.EVAL:
              return tf_estimator.EstimatorSpec(
                  mode=mode,
                  predictions=logits,
                  loss=loss,
                  eval_metric_ops=eval_metric_ops,
              )
          # Train.
          if mode == tf_estimator.ModeKeys.TRAIN:
              return tf_estimator.EstimatorSpec(
                  mode=mode,
                  loss=loss,
                  train_op=_get_train_op(
                      loss, self._train_op_fn, self._optimizer
                  ),
                  predictions=logits,
                  eval_metric_ops=eval_metric_ops,
              )
          raise ValueError("mode={} unrecognized".format(mode))
  
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 7 for calling the _MultiRankingHead obj's underlying member method code with example usage: obj.create_estimator_spec(features, mode, logits, labels, regularization_losses) and returns: tf_estimator, tf_estimator, tf_estimator