class_docstr: Univariate scorer using GAM.
  
  The scorer implements Neural Generalized Additive Ranking Model, which is an
  additive ranking model.
  See the [paper](https://arxiv.org/abs/2005.02553) for more details.
  
  Example usage:
  
  ```python
  scorer=GAMScorer(hidden_layer_dims=[16])
  ```
docstr: See `UnivariateScorer`.
docstr_tok: ["See","`","UnivariateScorer","`","."]
code: def _score_flattened(
      self,
      context_features: TensorDict,
      example_features: TensorDict,
  ) -> tf.Tensor:
      """See `UnivariateScorer`."""
      context_inputs = [
          tf.keras.layers.Flatten()(context_features[name])
          for name in sorted(context_features)
      ]
      example_inputs = [
          tf.keras.layers.Flatten()(example_features[name])
          for name in sorted(example_features)
      ]
      gam_kwargs = self._gam_kwargs
      # TODO: These parameters may be inferred from the call inputs.
      gam_kwargs.update(
          {
              "example_feature_num": len(example_inputs),
              "context_feature_num": len(context_inputs),
          }
      )
      flattened_logits, _, _ = layers.GAMLayer(**gam_kwargs)(
          inputs=(example_inputs, context_inputs)
      )
      return flattened_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 GAMScorer obj's underlying member method code with example usage: obj._score_flattened(context_features, example_features) and returns: flattened_logits