import tensorflow as tf

      update_second_moment_op = moving_averages.assign_moving_average(
          variable=self._moving_second_moment,
          value=second_moment,
          decay=self._decay_rate,
          name="update_moving_second_moment").op

      return update_mean_op, update_second_moment_op

    def build_no_ops():
      return (tf.no_op(), tf.no_op())

    # Only make the ops if we know that `is_training=True`, or the value of
    # `is_training` is unknown.
    is_training_const = utils.constant_value(is_training)
    if is_training_const is None or is_training_const:
      update_mean_op, update_second_moment_op = utils.smart_cond(
          is_training,
          build_update_ops,
