def METHOD_NAME():
  """Train MNIST for a number of steps."""
  # Tell TensorFlow that the model will be built into the default Graph.
  with tf.Graph().as_default():
    # Input images and labels.
    image_batch, label_batch = inputs(
        train=True, batch_size=FLAGS.batch_size, num_epochs=FLAGS.num_epochs)
    # Build a Graph that computes predictions from the inference model.
    logits = mnist.inference(image_batch, FLAGS.hidden1, FLAGS.hidden2)
    # Add to the Graph the loss calculation.
    loss = mnist.loss(logits, label_batch)
    # Add to the Graph operations that train the model.
    train_op = mnist.training(loss, FLAGS.learning_rate)
    # The op for initializing the variables.
    init_op = tf.group(tf.global_variables_initializer(),
                       tf.local_variables_initializer())
    # Create a session for running operations in the Graph.
    with tf.compat.v1.Session() as sess:
      # Initialize the variables (the trained variables and the
      # epoch counter).
      sess.run(init_op)
      try:
        step = 0
        while True:  # Train until OutOfRangeError
          start_time = time.time()
          # Run one step of the model.  The return values are
          # the activations from the `train_op` (which is
          # discarded) and the `loss` op.  To inspect the values
          # of your ops or variables, you may include them in
          # the list passed to sess.run() and the value tensors
          # will be returned in the tuple from the call.
          _, loss_value = sess.run([train_op, loss])
          duration = time.time() - start_time
          # Print an overview fairly often.
          if step % 100 == 0:
            print('Step %d: loss = %.2f (%.3f sec)' % (step, loss_value,
                                                       duration))
          step += 1
      except tf.errors.OutOfRangeError:
        print('Done training for %d epochs, %d steps.' % (FLAGS.num_epochs,
                                                          step))