class_docstr: Base class for univariate ranking network.
class_docstr_tok: ["Base","class","for","univariate","ranking","network","."]
docstr: Scores context and examples to return a score per document.
  
  Args:
    context_features: (dict) context feature names to 2D tensors of shape
      [batch_size, feature_dims].
    example_features: (dict) example feature names to 3D tensors of shape
      [batch_size, list_size, feature_dims].
    training: (bool) whether in train or inference mode.
    mask: (tf.Tensor) Mask is a tensor of shape [batch_size, list_size], which
      is True for a valid example and False for invalid one. If mask is None,
      all entries are valid.
  
  Returns:
    (tf.Tensor) A score tensor of shape [batch_size, list_size].
  
  Raises:
    ValueError: If `scorer` does not return a scalar output.
docstr_tok: ["Scores","context","and","examples","to","return","a","score","per","document",".","Args",":","context_features",":","(","dict",")","context","feature","names","to","2D","tensors","of","shape","[","batch_size",",","feature_dims","]",".","example_features",":","(","dict",")","example","feature","names","to","3D","tensors","of","shape","[","batch_size",",","list_size",",","feature_dims","]",".","training",":","(","bool",")","whether","in","train","or","inference","mode",".","mask",":","(","tf.Tensor",")","Mask","is","a","tensor","of","shape","[","batch_size",",","list_size","]",",","which","is","True","for","a","valid","example","and","False","for","invalid","one",".","If","mask","is","None",",","all","entries","are","valid",".","Returns",":","(","tf.Tensor",")","A","score","tensor","of","shape","[","batch_size",",","list_size","]",".","Raises",":","ValueError",":","If","`","scorer","`","does","not","return","a","scalar","output","."]
code: def compute_logits(
      self,
      context_features=None,
      example_features=None,
      training=None,
      mask=None,
  ):
      """Scores context and examples to return a score per document.
  
      Args:
        context_features: (dict) context feature names to 2D tensors of shape
          [batch_size, feature_dims].
        example_features: (dict) example feature names to 3D tensors of shape
          [batch_size, list_size, feature_dims].
        training: (bool) whether in train or inference mode.
        mask: (tf.Tensor) Mask is a tensor of shape [batch_size, list_size], which
          is True for a valid example and False for invalid one. If mask is None,
          all entries are valid.
  
      Returns:
        (tf.Tensor) A score tensor of shape [batch_size, list_size].
  
      Raises:
        ValueError: If `scorer` does not return a scalar output.
  
      """
      logits = listwise_scoring(
          self.score,
          context_features=context_features,
          example_features=example_features,
          training=training,
          mask=mask,
      )
      # Remove last dimension of shape = 1.
      try:
          logits = tf.squeeze(logits, axis=2)
      except:
          raise ValueError(
              "Logits not of shape: [batch_size, list_size, 1]. "
              "This could occur if the `scorer` does not return "
              "a scalar output."
          )
      return logits
  
imports: import abc
  import six
  import tensorflow.compat.v2
  from tensorflow_ranking.python import utils
  from tensorflow_ranking.python.keras import feature
label_desc: Use image node_id 3 for calling the UnivariateRankingNetwork obj's underlying member method code with example usage: obj.compute_logits(context_features, example_features, training, mask) and returns: logits