code: def _create_input_fn():
      def my_input_fn():
          feature_to_type = {
              "example_0.age": tf.io.FixedLenFeature([1], tf.int64),
              "example_1.age": tf.io.FixedLenFeature([1], tf.int64),
              "example_0.weight": tf.io.FixedLenFeature([1], tf.int64),
              "example_1.weight": tf.io.FixedLenFeature([1], tf.int64),
              "example_0.label": tf.io.FixedLenFeature([1], tf.float32),
              "example_1.label": tf.io.FixedLenFeature([1], tf.float32),
          }
          feature_1_proto = tf.train.Example()
          feature_2_proto = tf.train.Example()
          text_format.Merge(EXAMPLE_1_PROTO, feature_1_proto)
          text_format.Merge(EXAMPLE_2_PROTO, feature_2_proto)
  
          features_tensor = tf.io.parse_example(
              serialized=[
                  feature_1_proto.SerializeToString(),
                  feature_2_proto.SerializeToString(),
              ],
              features=feature_to_type,
          )
  
          # Create the dataset.
          dataset = tf.data.Dataset.from_tensor_slices(
              features_tensor
          ).batch(2)
  
          return next(iter(dataset))
  
      return my_input_fn
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl.testing import parameterized
  import numpy
  import tensorflow
  from tensorflow import estimator
  from google.protobuf import text_format
  from tensorflow.python.feature_column import feature_column_lib
  from tensorflow_ranking.python import feature
label_desc: Use image node_id 1 for calling a global function with example usage: _create_input_fn() and returns: my_input_fn, next