def METHOD_NAME(self, scheduler, warmup):
    if warmup and scheduler:
        schedulers = [warmup, scheduler]
        milestones = [self.warmup_iters]
        interval_rescaling = [self.warmup_prefix]
    elif warmup:
        schedulers = [warmup]
        milestones = []
        interval_rescaling = []
    elif scheduler:
        schedulers = [scheduler]
        milestones = []
        interval_rescaling = []
    else:
        raise ValueError("No scheduler can work")
    super().__init__(
        self.optimizer,
        schedulers=schedulers,
        milestones=milestones,
        interval_rescaling=interval_rescaling,
        last_step=self.last_step,
        verbose=self.verbose,
    )