def get_train_spec()

in recommended-item-search/softmax_main.py [0:0]


def get_train_spec():
  """Get train spec for Estimator."""
  profile_hook = tf.train.ProfilerHook(
      save_steps=FLAGS.save_checkpoints_steps, output_dir=FLAGS.model_dir,
      show_memory=True)
  train_input_fn = input_pipeline.generate_input_fn(
      file_pattern=FLAGS.train_filename, batch_size=FLAGS.train_batch_size,
      mode=tf.estimator.ModeKeys.TRAIN)
  train_spec = tf.estimator.TrainSpec(
      input_fn=train_input_fn, max_steps=FLAGS.train_max_steps,
      hooks=[profile_hook])
  return train_spec