def _global_step(hparams):
  """Adjust global step if a multi-step optimizer is used."""
  step = tf.cast(tf.train.get_or_create_global_step(), tf.float32)
  multiplier = hparams.optimizer_multistep_accumulate_steps
  if not multiplier:
    return step

  tf.logging.info("Dividing global step by %d for multi-step optimizer."
                  % multiplier)
  return step / tf.cast(multiplier, tf.float32)
Adjust global step if a multi-step optimizer is used.
tensor2tensor/models/research/transformer_vae_flow_prior_ops.py