def METHOD_NAME(self, closure: Callable = None):
    """Performs a single optimization step.
    Args:
        closure (callable, optional): A closure that reevaluates the model
            and returns the loss.
    """
    with flow.no_grad():
        loss = None
        if closure is not None:
            with flow.enable_grad():
                loss = closure()
        for param_group in self.param_groups:
            kwargs = {
                "learning_rate": param_group["lr"],
                "l2": param_group["weight_decay"],
                "epsilon": param_group["eps"],
                "lr_decay": param_group["lr_decay"],
                "train_step_val": self.state["step"] + 1,
            }
            if param_group["contiguous_params"]:
                param_list = param_group.contiguous_parameters
            else:
                param_list = param_group.parameters
            for param in param_list:
                if param.grad is None:
                    continue
                sum_tensor = self.state[param]["sum"]
                flow._C.dispatch_adagrad_update(
                    self._op, (param, param.grad, sum_tensor), **kwargs
                )
        self.state["step"] = self.state["step"] + 1
        return loss