optimum/graphcore/trainer.py
def _load_optimizer_and_scheduler(self, checkpoint):
        """If optimizer and scheduler states exist, load them."""
        if checkpoint is None:
            return

        if os.path.isfile(os.path.join(checkpoint, OPTIMIZER_NAME)) and os.path.isfile(
            os.path.join(checkpoint, SCHEDULER_NAME)
        ):
            self.optimizer.load_state_dict(torch.load(os.path.join(checkpoint, OPTIMIZER_NAME)))
            with warnings.catch_warnings(record=True) as caught_warnings:
                self.lr_scheduler.load_state_dict(torch.load(os.path.join(checkpoint, SCHEDULER_NAME)))
            reissue_pt_warnings(caught_warnings)

            self.training_model.setOptimizer(self.optimizer)
If optimizer and scheduler states exist, load them.
If optimizer and scheduler states exist, load them.
If optimizer and scheduler states exist load them .
def _load_optimizer_and_scheduler(self, checkpoint):
        if checkpoint is None:
            return
        if os.path.isfile(os.path.join(checkpoint, OPTIMIZER_NAME)) and os.path.isfile(
            os.path.join(checkpoint, SCHEDULER_NAME)
        ):
            self.optimizer.load_state_dict(torch.load(os.path.join(checkpoint, OPTIMIZER_NAME)))
            with warnings.catch_warnings(record=True) as caught_warnings:
                self.lr_scheduler.load_state_dict(torch.load(os.path.join(checkpoint, SCHEDULER_NAME)))
            reissue_pt_warnings(caught_warnings)
            self.training_model.setOptimizer(self.optimizer)
def _load_optimizer_and_scheduler ( self , checkpoint ) : if checkpoint is None : return if os . path . isfile ( os . path . join ( checkpoint , OPTIMIZER_NAME ) ) and os . path . isfile ( os . path . join ( checkpoint , SCHEDULER_NAME ) ) : self . optimizer . load_state_dict ( torch . load ( os . path . join ( checkpoint , OPTIMIZER_NAME ) ) ) with warnings . catch_warnings ( record = True ) as caught_warnings : self . lr_scheduler . load_state_dict ( torch . load ( os . path . join ( checkpoint , SCHEDULER_NAME ) ) ) reissue_pt_warnings ( caught_warnings ) self . training_model . setOptimizer ( self . optimizer )
If optimizer and scheduler states exist, load them.
If optimizer and scheduler states exist load them .
"""If optimizer and scheduler states exist, load them."""
self
checkpoint