class_docstr: Interface for ranking head.
class_docstr_tok: ["Interface","for","ranking","head","."]
docstr: Returns an `EstimatorSpec`.
  
  Args:
    features: Input `dict` of `Tensor` or `SparseTensor` objects.
    mode: Estimator's `ModeKeys`.
    logits: A `Tensor` or a dict of (name, `Tensor`). Each `Tensor` has the
      shape of [batch_size, D]. Each value is the ranking score of the
      corresponding item. `D` is usually the `list_size`. It might be changed
      when `mode` is `PREDICT`. When `logits` is a dict, it is for multi-task
      setting.
    labels: A `Tensor` or a dict of (name, `Tensor`) representing relevance
      labels. Each `Tensor` has the same shape as `logits`. `labels` is
      required argument when `mode` equals `TRAIN` or `EVAL`.
    regularization_losses: A list of additional scalar losses to be added to
      the training loss, such as regularization losses. These losses are
      usually expressed as a batch average, so for best results users need to
      set `loss_reduction=SUM_OVER_BATCH_SIZE` or
      `loss_reduction=SUM_OVER_NONZERO_WEIGHTS` when creating the head to
      avoid scaling errors.
  
  Returns:
    `EstimatorSpec`.
docstr_tok: ["Returns","an","`","EstimatorSpec","`",".","Args",":","features",":","Input","`","dict","`","of","`","Tensor","`","or","`","SparseTensor","`","objects",".","mode",":","Estimator","'s","`","ModeKeys","`",".","logits",":","A","`","Tensor","`","or","a","dict","of","(","name",",","`","Tensor","`",")",".","Each","`","Tensor","`","has","the","shape","of","[","batch_size",",","D","]",".","Each","value","is","the","ranking","score","of","the","corresponding","item",".","`","D","`","is","usually","the","`","list_size","`",".","It","might","be","changed","when","`","mode","`","is","`","PREDICT","`",".","When","`","logits","`","is","a","dict",",","it","is","for","multi-task","setting",".","labels",":","A","`","Tensor","`","or","a","dict","of","(","name",",","`","Tensor","`",")","representing","relevance","labels",".","Each","`","Tensor","`","has","the","same","shape","as","`","logits","`",".","`","labels","`","is","required","argument","when","`","mode","`","equals","`","TRAIN","`","or","`","EVAL","`",".","regularization_losses",":","A","list","of","additional","scalar","losses","to","be","added","to","the","training","loss",",","such","as","regularization","losses",".","These","losses","are","usually","expressed","as","a","batch","average",",","so","for","best","results","users","need","to","set","`","loss_reduction=SUM_OVER_BATCH_SIZE","`","or","`","loss_reduction=SUM_OVER_NONZERO_WEIGHTS","`","when","creating","the","head","to","avoid","scaling","errors",".","Returns",":","`","EstimatorSpec","`","."]
code: def create_estimator_spec(
      self,
      features,
      mode,
      logits,
      labels=None,
      regularization_losses=None,
  ):
      """Returns an `EstimatorSpec`.
  
      Args:
        features: Input `dict` of `Tensor` or `SparseTensor` objects.
        mode: Estimator's `ModeKeys`.
        logits: A `Tensor` or a dict of (name, `Tensor`). Each `Tensor` has the
          shape of [batch_size, D]. Each value is the ranking score of the
          corresponding item. `D` is usually the `list_size`. It might be changed
          when `mode` is `PREDICT`. When `logits` is a dict, it is for multi-task
          setting.
        labels: A `Tensor` or a dict of (name, `Tensor`) representing relevance
          labels. Each `Tensor` has the same shape as `logits`. `labels` is
          required argument when `mode` equals `TRAIN` or `EVAL`.
        regularization_losses: A list of additional scalar losses to be added to
          the training loss, such as regularization losses. These losses are
          usually expressed as a batch average, so for best results users need to
          set `loss_reduction=SUM_OVER_BATCH_SIZE` or
          `loss_reduction=SUM_OVER_NONZERO_WEIGHTS` when creating the head to
          avoid scaling errors.
  
      Returns:
        `EstimatorSpec`.
      """
      raise NotImplementedError("Calling an abstract method.")
  
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 2 for calling the _AbstractRankingHead obj's underlying member method code with example usage: obj.create_estimator_spec(features, mode, logits, labels, regularization_losses) without return types