class_docstr: Interface for a ranking model.
class_docstr_tok: ["Interface","for","a","ranking","model","."]
docstr: Computes the logits for the given inputs.
  
  This is the core interface function for a ranking model and it computes the
  logits for a list/set of examples.  The logic of a specific ranking model
  should be implemented in `_compute_logits_impl`. For example, in the
  simplest case, the logits contain a float value for each example and we also
  have a single label for each example. In a more advanced multi-task setting,
  logits are a `dict` that maps task name to task-specific logits.
  
  Args:
    features: (dict) A dict of Tensors or SparseTensors of shape [batch_size,
      list_size, ...] for example features and shape [batch_size, ...] for
      context features.
    labels: (Tensor or dict) A dense Tensor representing relevance for the
      ranking problem or a `dict` of Tensors in the multi-task setting.
    mode: See tf.estimator.ModeKeys.
    params: See tf.estimator model_fn. Hyperparameters for the model.
    config: See tf.estimator model_fn.
  
  Returns:
    A dict of Tensors for multi-task or a Tensor for single task that
    represents the logits.
docstr_tok: ["Computes","the","logits","for","the","given","inputs",".","This","is","the","core","interface","function","for","a","ranking","model","and","it","computes","the","logits","for","a","list\/set","of","examples",".","The","logic","of","a","specific","ranking","model","should","be","implemented","in","`","_compute_logits_impl","`",".","For","example",",","in","the","simplest","case",",","the","logits","contain","a","float","value","for","each","example","and","we","also","have","a","single","label","for","each","example",".","In","a","more","advanced","multi-task","setting",",","logits","are","a","`","dict","`","that","maps","task","name","to","task-specific","logits",".","Args",":","features",":","(","dict",")","A","dict","of","Tensors","or","SparseTensors","of","shape","[","batch_size",",","list_size",",","...","]","for","example","features","and","shape","[","batch_size",",","...","]","for","context","features",".","labels",":","(","Tensor","or","dict",")","A","dense","Tensor","representing","relevance","for","the","ranking","problem","or","a","`","dict","`","of","Tensors","in","the","multi-task","setting",".","mode",":","See","tf.estimator.ModeKeys",".","params",":","See","tf.estimator","model_fn",".","Hyperparameters","for","the","model",".","config",":","See","tf.estimator","model_fn",".","Returns",":","A","dict","of","Tensors","for","multi-task","or","a","Tensor","for","single","task","that","represents","the","logits","."]
code: def compute_logits(self, features, labels, mode, params, config):
      """Computes the logits for the given inputs.
  
      This is the core interface function for a ranking model and it computes the
      logits for a list/set of examples.  The logic of a specific ranking model
      should be implemented in `_compute_logits_impl`. For example, in the
      simplest case, the logits contain a float value for each example and we also
      have a single label for each example. In a more advanced multi-task setting,
      logits are a `dict` that maps task name to task-specific logits.
  
      Args:
        features: (dict) A dict of Tensors or SparseTensors of shape [batch_size,
          list_size, ...] for example features and shape [batch_size, ...] for
          context features.
        labels: (Tensor or dict) A dense Tensor representing relevance for the
          ranking problem or a `dict` of Tensors in the multi-task setting.
        mode: See tf.estimator.ModeKeys.
        params: See tf.estimator model_fn. Hyperparameters for the model.
        config: See tf.estimator model_fn.
  
      Returns:
        A dict of Tensors for multi-task or a Tensor for single task that
        represents the logits.
      """
      with tf.compat.v1.name_scope("transform"):
          context_features, example_features = self._call_transform_fn(
              features, mode, params
          )
          # Check feature tensor shape.
          for name, value in six.iteritems(example_features):
              tensor_shape = tf.convert_to_tensor(value=value).shape
              if (
                  tensor_shape is not None
                  and tensor_shape.rank is not None
                  and tensor_shape.rank < 3
              ):
                  tf.compat.v1.logging.warning(
                      'Feature "{}" has invalid feature tensor shape {}. '
                      "Expected shape has at least 3 dims: "
                      "(batch_size, list_size, feature_size).".format(
                          name, tensor_shape
                      )
                  )
  
      logits = self._compute_logits_impl(
          context_features,
          example_features,
          labels,
          mode,
          params,
          config,
      )
  
      if mode == tf_estimator.ModeKeys.PREDICT:
          return logits
      else:
          features.update(context_features)
          features.update(example_features)
          return logits
  
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
  from tensorflow.python.util import function_utils
  from tensorflow_ranking.python import feature
  from tensorflow_ranking.python import utils
label_desc: Use image node_id 3 for calling the _RankingModel obj's underlying member method code with example usage: obj.compute_logits(features, labels, mode, params, config) and returns: logits, logits