def METHOD_NAME(
    global_step: tf_compat.Tensor,
    start_step: int,
    end_step: int,
    step_size: int,
    init_lr: float,
    gamma: float,
    name: str = "exponential_lr_schedule",
) -> tf_compat.Tensor:
    """
    Create an exponential learning rate schedule in the current graph.
    Multiplies init_lr by gamma after each step_size interval has passed.
    Ex: lr = init_lr * (gamma ** NUM_UPDATES)
    :param global_step: the global step used for training
    :param start_step: the step to start the exponential schedule on
    :param end_step: the step to end the exponential schedule on,
        can be set to -1 and in that event will continually update the LR
    :param step_size: the number of steps between each gamma update to the init_lr
    :param init_lr: the learning rate to start the schedule with
    :param gamma: the decay weight to decrease init_lr by after every step_size interval
    :param name: the name scope to create the graph under
    :return: the calculated learning rate tensor
    """
    with tf_compat.name_scope(name):
        global_step = tf_compat.cast(global_step, tf_compat.int64)
        max_updates = tf_compat.constant(
            (end_step - start_step) // step_size if end_step > 0 else -1,
            dtype=tf_compat.int64,
            name="max_updates",
        )
        start_step = tf_compat.constant(
            start_step, dtype=tf_compat.int64, name="start_step"
        )
        end_step = tf_compat.constant(end_step, dtype=tf_compat.int64, name="end_step")
        init_lr = tf_compat.constant(init_lr, dtype=tf_compat.float32, name="init_lr")
        step_size = tf_compat.constant(
            step_size, dtype=tf_compat.int64, name="step_size"
        )
        gamma = tf_compat.constant(gamma, dtype=tf_compat.float32, name="gamma")
        before = tf_compat.less(global_step, start_step, name="before")
        after = tf_compat.logical_and(
            tf_compat.greater_equal(global_step, end_step, name="after"),
            tf_compat.not_equal(end_step, tf_compat.constant(-1, tf_compat.int64)),
        )
        def _calc_lr():
            steps = tf_compat.subtract(global_step, start_step)
            updates = tf_compat.cond(
                after,
                lambda: max_updates,
                lambda: tf_compat.cast(
                    tf_compat.floor(tf_compat.divide(steps, step_size)),
                    tf_compat.int64,
                ),
            )
            mult_g = tf_compat.pow(gamma, tf_compat.cast(updates, tf_compat.float32))
            return tf_compat.multiply(init_lr, mult_g)
        learning_rate = tf_compat.cond(
            before, lambda: init_lr, _calc_lr, name="learning_rate"
        )
    return learning_rate