def training(loss, global_step):
  """Sets up the training Ops.
  Creates a summarizer to track the loss over time in TensorBoard.
  Creates an optimizer and applies the gradients to all trainable variables.
  The Op returned by this function is what must be passed to the
  `sess.run()` call to cause the model to train.
  Args:
    loss: Loss tensor, from loss().
    learning_rate: The learning rate to use for gradient descent.
  Returns:
    train_op: The Op for training.
  """
  # Variables that affect learning rate.
  num_batches_per_epoch = FLAGS.batch_size / NUM_EXAMPLES_PER_EPOCH_FOR_TRAIN
  decay_steps = int(num_batches_per_epoch * NUM_EPOCHS_PER_DECAY)

  print('Decay steps is: ', decay_steps)
  # Decay the learning rate exponentially based on the number of steps.
  lr = tf.train.exponential_decay(INITIAL_LEARNING_RATE,
                                  global_step,
                                  decay_steps,
                                  LEARNING_RATE_DECAY_FACTOR,
                                  staircase=True)
  tf.scalar_summary('learning_rate', lr)
  # Add a scalar summary for the snapshot loss.
  tf.scalar_summary(loss.op.name, loss)

  # Create the adam or gradient descent optimizer with the given learning rate.
  optimizer = tf.train.AdamOptimizer(lr)
  # optimizer = tf.train.GradientDescentOptimizer(lr)

  # Use the optimizer to apply the gradients that minimize the loss
  # (and also increment the global step counter) as a single training step.
  train_op = optimizer.minimize(loss, global_step=global_step)

  return train_op
dataset/ETHPy150Open HamedMP/ImageFlow/example_project/my_cifar.py/training/swapped operands of `/`