human
I am working on the file "Experimental/distribution/multi-node/mnist-keras-2/Keras_MNIST_local.ipynb".
The first task is:
Serving input function
Can you write Python program for it?
 What is a the Python program you requested?
assistant
#Here is the Python program you requested.

def get_serving_input_fn(input_signature):
  def preprocess(x):
    return tf.reshape(x, [-1, 28*28]) / 255.0

  def serving_input_fn():
    receiver_tensor = {'X': tf.placeholder(tf.float32, shape=[None, 28, 28])}
    features = {input_signature: tf.map_fn(preprocess, receiver_tensor['X'])}
    return tf.estimator.export.ServingInputReceiver(features, receiver_tensor)
  return serving_input_fn