code: def make_regressor_input_fn(feature_spec):
      """Train input function.
  
      Args:
        feature_spec: a dictionary mapping feature_name to Tensor or SparseTensor.
  
      Returns:
        A function.
      """
  
      def _input_fn():
          """Example-based input function."""
  
          serialized_examples = [
              x.SerializeToString()
              for x in [
                  util.make_example(
                      age=1.0, language="english", label=4.0
                  ),
                  util.make_example(
                      age=2.0, language="english", label=7.0
                  ),
                  util.make_example(
                      age=3.0, language="english", label=10.0
                  ),
                  util.make_example(
                      age=4.0, language="english", label=13.0
                  ),
                  util.make_example(
                      age=1.0, language="chinese", label=3.0
                  ),
                  util.make_example(
                      age=2.0, language="chinese", label=6.0
                  ),
                  util.make_example(
                      age=3.0, language="chinese", label=9.0
                  ),
                  util.make_example(
                      age=4.0, language="chinese", label=12.0
                  ),
                  util.make_example(
                      age=10.0, language="english", label=31.0
                  ),
                  util.make_example(
                      age=20.0, language="english", label=61.0
                  ),
                  util.make_example(
                      age=30.0, language="english", label=91.0
                  ),
                  util.make_example(
                      age=40.0, language="english", label=121.0
                  ),
                  util.make_example(
                      age=10.0, language="chinese", label=30.0
                  ),
                  util.make_example(
                      age=20.0, language="chinese", label=60.0
                  ),
                  util.make_example(
                      age=30.0, language="chinese", label=90.0
                  ),
                  util.make_example(
                      age=40.0, language="chinese", label=120.0
                  ),
              ]
          ]
          features = tf.io.parse_example(
              serialized=serialized_examples, features=feature_spec
          )
          labels = features.pop("label")
          return features, labels
  
      return _input_fn
  
file_path: model-analysis/tensorflow_model_analysis/eval_saved_model/example_trainers/util.py
imports: import tensorflow
  from tensorflow_model_analysis.eval_saved_model import export
  from tensorflow_model_analysis.eval_saved_model import util
label_desc: Use image node_id 1 for calling a global function with example usage: make_regressor_input_fn(feature_spec) and returns: _input_fn, features,  labels