code: def make_serving_input_fn():
      """Returns serving input fn."""
      context_feature_spec = tf.feature_column.make_parse_example_spec(
          context_feature_columns().values()
      )
      example_feature_spec = tf.feature_column.make_parse_example_spec(
          example_feature_columns().values()
      )
      if FLAGS.listwise_inference:
          # Exports accept the specified FLAGS.data_format during serving.
          return tfr.data.build_ranking_serving_input_receiver_fn(
              data_format=FLAGS.data_format,
              context_feature_spec=context_feature_spec,
              example_feature_spec=example_feature_spec,
              mask_feature_name=_MASK,
          )
      elif FLAGS.group_size == 1:
          # Exports accept tf.Example when group_size = 1.
          feature_spec = {}
          feature_spec.update(example_feature_spec)
          feature_spec.update(context_feature_spec)
          return tf_estimator.export.build_parsing_serving_input_receiver_fn(
              feature_spec
          )
      else:
          raise ValueError(
              "FLAGS.group_size should be 1, but is {} when "
              "FLAGS.export_listwise_inference is False".format(
                  FLAGS.group_size
              )
          )
  
file_path: ranking/tensorflow_ranking/examples/tf_ranking_tfrecord.py
imports: from absl import flags
  import tensorflow
  from tensorflow import estimator
  import tensorflow_ranking
label_desc: Use image node_id 4 for calling a global function with example usage: make_serving_input_fn() and returns: tfr, tf_estimator