code: def scoring_function(context_features, example_features, mode):
      """A feed-forward network to score query-document pairs."""
      with tf.compat.v1.name_scope("input_layer"):
          context_input = [
              tf.compat.v1.layers.flatten(context_features[name])
              for name in sorted(context_feature_columns())
          ]
          example_input = [
              tf.compat.v1.layers.flatten(example_features[name])
              for name in sorted(example_feature_columns())
          ]
          input_layer = tf.concat(context_input + example_input, 1)
  
      is_training = mode == tf_estimator.ModeKeys.TRAIN
      cur_layer = input_layer
      cur_layer = tf.compat.v1.layers.batch_normalization(
          cur_layer, training=is_training, momentum=0.99
      )
  
      layer_dims = [int(d) for d in FLAGS.hidden_layer_dims.split(",")]
      for layer_width in layer_dims:
          cur_layer = tf.compat.v1.layers.dense(
              cur_layer, units=layer_width
          )
          cur_layer = tf.compat.v1.layers.batch_normalization(
              cur_layer, training=is_training, momentum=0.99
          )
          cur_layer = tf.nn.relu(cur_layer)
          cur_layer = tf.compat.v1.layers.dropout(
              inputs=cur_layer,
              rate=FLAGS.dropout_rate,
              training=is_training,
          )
      return tf.compat.v1.layers.dense(cur_layer, units=1)
  
file_path: ranking/tensorflow_ranking/extension/examples/pipeline_example.py
imports: from absl import flags
  import tensorflow
  from tensorflow import estimator
  import tensorflow_ranking
label_desc: Use image node_id 3 for calling a global function with example usage: scoring_function(context_features, example_features, mode) and returns: tf