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: See `Scorer`.
docstr_tok: ["See","`","Scorer","`","."]
code: def __call__(
      self,
      context_features: TensorDict,
      example_features: TensorDict,
      mask: tf.Tensor,
  ) -> Union[tf.Tensor, TensorDict]:
      """See `Scorer`."""
      (
          flattened_context_features,
          flattened_example_features,
      ) = layers.FlattenList()(
          inputs=(context_features, example_features, mask)
      )
  
      flattened_logits = self._score_flattened(
          flattened_context_features, flattened_example_features
      )
  
      # Handle a dict of logits for the multi-task setting.
      if isinstance(flattened_logits, dict):
          logits = {
              k: layers.RestoreList(name=k)(inputs=(v, mask))
              for k, v in flattened_logits.items()
          }
      else:
          logits = layers.RestoreList()(inputs=(flattened_logits, mask))
      return logits
  
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 2 for calling the UnivariateScorer obj's underlying member method code with example usage: obj.__call__(context_features, example_features, mask) and returns: logits