class_docstr: Interface to build a `tf.keras.Model` for ranking with a mask Tensor.
  
  The `ModelBuilderWithMask` class is an abstract class to build a ranking model
  based on dense Tensors and a mask Tensor to indicate the padded ones.
  All the boilerplate codes related to constructing a `tf.keras.Model` are
  integrated in the ModelBuilder class.
  
  To be implemented by subclasses:
  
    * `create_inputs()`: Contains the logic to create `tf.keras.Input` for
    context and example inputs and mask for valid list items.
    * `preprocess()`: Contains the logic to preprocess context and example
    inputs.
    * `score()`: Contains the logic to score examples in list and return
    outputs.
  
  Example subclass implementation:
  
  ```python
  class SimpleModelBuilder(ModelBuilderWithMask):
  
    def __init__(self, context_feature_spec, example_feature_spec,
                 mask_feature_name, name=None):
      self._context_feature_spec = context_feature_spec
      self._example_feature_spec = example_feature_spec
      self._mask_feature_name = mask_feature_name
      self._name = name
  
    def create_inputs(self):
      context_inputs = {
          name: tf.keras.Input(
              shape=tuple(spec.shape),
              name=name,
              dtype=spec.dtype
          ) for name, spec in self._context_feature_spec.items()
      }
      example_inputs = {
          name: tf.keras.Input(
              shape=(None,) + tuple(spec.shape),
              name=name,
              dtype=spec.dtype
          ) for name, spec in self._example_feature_spec.items()
      }
      mask = tf.keras.Input(
          name=self._mask_feature_name, shape=(None,), dtype=tf.bool)
      return context_inputs, example_inputs, mask
  
    def preprocess(self, context_inputs, example_inputs, mask):
      context_features = {
          name: tf.math.log1p(
              tf.abs(tensor)) for name, tensor in context_inputs.items()
      }
      example_features = {
          name: tf.math.log1p(
              tf.abs(tensor)) for name, tensor in example_inputs.items()
      }
      return context_features, example_features
  
    def score(self, context_features, example_features, mask):
      x = tf.concat([tensor for tensor in example_features.values()], -1)
      return tf.keras.layers.Dense(1)(x)
  ```
docstr: Scores all examples and returns outputs.
  
  Example usage:
  
  ```python
  model_builder = SimpleModelBuilder(
      {},
      {"example_feature_1": tf.io.FixedLenFeature(
          shape=(1,), dtype=tf.float32, default_value=0.0)},
      "list_mask", "model_builder")
  context_inputs, example_inputs, mask = model_builder.create_inputs()
  context_features, example_features = model_builder.preprocess(
      context_inputs, example_inputs, mask)
  scores = model_builder.score(context_features, example_features)
  ```
  
  Args:
    context_features: maps from context feature keys to [batch_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.
    mask: [batch_size, list_size]-tensor of mask for valid examples.
  
  Returns:
    A [batch_size, list_size]-tensor of logits or a dict mapping task name to
    logits in the multi-task setting.
docstr_tok: ["Scores","all","examples","and","returns","outputs",".","Example","usage",":","``","`","python","model_builder","=","SimpleModelBuilder","(","{","}",",","{","``","example_feature_1","''",":","tf.io.FixedLenFeature","(","shape=","(","1",",",")",",","dtype=tf.float32",",","default_value=0.0",")","}",",","``","list_mask","''",",","``","model_builder","''",")","context_inputs",",","example_inputs",",","mask","=","model_builder.create_inputs","(",")","context_features",",","example_features","=","model_builder.preprocess","(","context_inputs",",","example_inputs",",","mask",")","scores","=","model_builder.score","(","context_features",",","example_features",")","``","`","Args",":","context_features",":","maps","from","context","feature","keys","to","[","batch_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",".","mask",":","[","batch_size",",","list_size","]","-tensor","of","mask","for","valid","examples",".","Returns",":","A","[","batch_size",",","list_size","]","-tensor","of","logits","or","a","dict","mapping","task","name","to","logits","in","the","multi-task","setting","."]
code: def score(
      self,
      context_features: TensorDict,
      example_features: TensorDict,
      mask: tf.Tensor,
  ) -> Union[TensorLike, TensorDict]:
      """Scores all examples and returns outputs.
  
      Example usage:
  
      ```python
      model_builder = SimpleModelBuilder(
          {},
          {"example_feature_1": tf.io.FixedLenFeature(
              shape=(1,), dtype=tf.float32, default_value=0.0)},
          "list_mask", "model_builder")
      context_inputs, example_inputs, mask = model_builder.create_inputs()
      context_features, example_features = model_builder.preprocess(
          context_inputs, example_inputs, mask)
      scores = model_builder.score(context_features, example_features)
      ```
  
      Args:
        context_features: maps from context feature keys to [batch_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.
        mask: [batch_size, list_size]-tensor of mask for valid examples.
  
      Returns:
        A [batch_size, list_size]-tensor of logits or a dict mapping task name to
        logits in the multi-task setting.
      """
      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 4 for calling the ModelBuilderWithMask obj's underlying member method code with example usage: obj.score(context_features, example_features, mask) without return types