from __future__ import annotations

from typing import Any, Optional

from paddle.fluid import core as core
from paddle.fluid.framework import Variable as Variable
from paddle.optimizer import Optimizer

class ModelAverage(Optimizer):
    helper: Any = ...
    average_window: Any = ...
    min_average_window: Any = ...
    max_average_window: Any = ...
    type: str = ...
    apply_program: Any = ...
    restore_program: Any = ...
    def __init__(
        self,
        average_window_rate: Any,
        parameters: Optional[Any] = ...,
        min_average_window: int = ...,
        max_average_window: int = ...,
        name: Optional[Any] = ...,
    ) -> None: ...
    def minimize(
        self,
        loss: Any,
        startup_program: Optional[Any] = ...,
        parameters: Optional[Any] = ...,
        no_grad_set: Optional[Any] = ...,
    ) -> None: ...
    def step(self) -> None: ...
    def apply(self, executor: Optional[Any] = ..., need_restore: bool = ...) -> None: ...
    def restore(self, executor: Optional[Any] = ...) -> None: ...
