def step_update(self, num_updates):
        """Update the learning rate after each update."""
        """ if there is warmup"""
        if self.args.warmup_updates > 0:
            if num_updates <= self.args.warmup_updates:
                self.lr = self.args.warmup_init_lr + num_updates*self.lr_step
                self.optimizer.set_lr(self.lr)
            else:
                if self.warmup_end is False:
                    self.warmup_end = True
        """else do nothing """
        return self.optimizer.get_lr()
Update the learning rate after each update.
infoxlm/fairseq/fairseq/optim/lr_scheduler/reduce_lr_on_plateau.py