def create_training_input_fn(model_config, directory, filepaths, use_tpu):
  """Creates an input function that can be used with tf.learn estimators."""

  def input_fn(params):
    return get_features_and_labels(
        [os.path.join(directory, filepath) for filepath in filepaths],
        _get_batch_size(model_config, params, use_tpu),
        model_config,
        use_tpu,
        shuffle=True,
        num_epochs=None,
        scope='train_input_fn')

  return input_fn
Creates an input function that can be used with tf.learn estimators.
language/xsp/model/input_pipeline.py