optimum/graphcore/trainer.py
def create_scheduler(self, num_training_steps: int, optimizer: torch.optim.Optimizer = None):
        """
        Setup the scheduler. The optimizer of the trainer must have been set up either before this method is called or
        passed as an argument.

        Args:
            num_training_steps (int): The number of training steps to do.
        """
        optimizer = self.optimizer if optimizer is None else optimizer
        if self.lr_scheduler is None:
            self.lr_scheduler = get_scheduler(
                self.args.lr_scheduler_type,
                optimizer=optimizer,
                num_warmup_steps=self.args.get_warmup_steps(num_training_steps),
                num_training_steps=num_training_steps,
            )
            optimizer._step_count = 1

        return self.lr_scheduler

        Setup the scheduler. The optimizer of the trainer must have been set up either before this method is called or
        passed as an argument.

        Args:
            num_training_steps (int): The number of training steps to do.
        
Setup the scheduler. The optimizer of the trainer must have been set up either before this method is called or
passed as an argument.
Setup the scheduler . The optimizer of the trainer must have been set up either before this method is called or passed as an argument .
def create_scheduler(self, num_training_steps: int, optimizer: torch.optim.Optimizer = None):
        optimizer = self.optimizer if optimizer is None else optimizer
        if self.lr_scheduler is None:
            self.lr_scheduler = get_scheduler(
                self.args.lr_scheduler_type,
                optimizer=optimizer,
                num_warmup_steps=self.args.get_warmup_steps(num_training_steps),
                num_training_steps=num_training_steps,
            )
            optimizer._step_count = 1
        return self.lr_scheduler
def create_scheduler ( self , num_training_steps : int , optimizer : torch . optim . Optimizer = None ) : optimizer = self . optimizer if optimizer is None else optimizer if self . lr_scheduler is None : self . lr_scheduler = get_scheduler ( self . args . lr_scheduler_type , optimizer = optimizer , num_warmup_steps = self . args . get_warmup_steps ( num_training_steps ) , num_training_steps = num_training_steps , ) optimizer . _step_count = 1 return self . lr_scheduler
Setup the scheduler.
Setup the scheduler .
"""
        Setup the scheduler. The optimizer of the trainer must have been set up either before this method is called or
        passed as an argument.

        Args:
            num_training_steps (int): The number of training steps to do.
        """
self
num_training_steps
int
The number of training steps to do.
The number of training steps to do .
optimizer
torch.optim.Optimizer