class_docstr: Interface for univariate scorer.
  
  The `UnivariateScorer` class is an abstract class to implement `score` in
  `ModelBuilder` in tfr.keras with a univariate scoring function.
  
  To be implemented by subclasses:
  
    * `_score_flattened()`: Contains the logic to do the univariate scoring on
    flattened context and example features.
  
  Example subclass implementation:
  
  ```python
  class SimpleUnivariateScorer(UnivariateScorer):
  
    def _score_flattened(self, context_features, example_features):
      x = tf.concat([tensor for tensor in example_features.values()], -1)
      return tf.keras.layers.Dense(1)(x)
  ```
docstr: Computes the flattened logits.
  
  Args:
    context_features: maps from context feature keys to [batch_size *
      list_size, feature_dims]-tensors of preprocessed context features.
    example_features: maps from example feature keys to [batch_size *
      list_size, feature_dims]-tensors of preprocessed example features.
  
  Returns:
    A tf.Tensor of size [batch_size * list_size, 1] or a dict maps output
      names to tf.Tensors of size [batch_size * list_size, 1].
docstr_tok: ["Computes","the","flattened","logits",".","Args",":","context_features",":","maps","from","context","feature","keys","to","[","batch_size","*","list_size",",","feature_dims","]","-tensors","of","preprocessed","context","features",".","example_features",":","maps","from","example","feature","keys","to","[","batch_size","*","list_size",",","feature_dims","]","-tensors","of","preprocessed","example","features",".","Returns",":","A","tf.Tensor","of","size","[","batch_size","*","list_size",",","1","]","or","a","dict","maps","output","names","to","tf.Tensors","of","size","[","batch_size","*","list_size",",","1","]","."]
code: def _score_flattened(
      self,
      context_features: TensorDict,
      example_features: TensorDict,
  ) -> Union[tf.Tensor, TensorDict]:
      """Computes the flattened logits.
  
      Args:
        context_features: maps from context feature keys to [batch_size *
          list_size, feature_dims]-tensors of preprocessed context features.
        example_features: maps from example feature keys to [batch_size *
          list_size, feature_dims]-tensors of preprocessed example features.
  
      Returns:
        A tf.Tensor of size [batch_size * list_size, 1] or a dict maps output
          names to tf.Tensors of size [batch_size * list_size, 1].
      """
      raise NotImplementedError("Calling an abstract method.")
  
imports: import abc
  from typing import Any, Callable, Dict, List, Optional, Tuple, Union
  from absl import logging
  import tensorflow
  from tensorflow_ranking.python.keras import feature
  from tensorflow_ranking.python.keras import layers
label_desc: Use image node_id 1 for calling the UnivariateScorer obj's underlying member method code with example usage: obj._score_flattened(context_features, example_features) without return types