(self, step)
Main entry point for model saver
        It wraps the `_save` method with checks and apply `keep_checkpoint`
        related logic
Main entry point for model saver
        It wraps the `_save` method with checks and apply `keep_checkpoint`
        related logic
Main entry point for model saver It wraps the _save method with checks and apply keep_checkpoint related logic
def maybe_save(self, step):
        """
        Main entry point for model saver
        It wraps the `_save` method with checks and apply `keep_checkpoint`
        related logic
        """
        if self.keep_checkpoint == 0:
            return

        if step % self.save_checkpoint_steps != 0:
            return

        chkpt, chkpt_name = self._save(step)

        if self.keep_checkpoint > 0:
            if len(self.checkpoint_queue) == self.checkpoint_queue.maxlen:
                todel = self.checkpoint_queue.popleft()
                self._rm_checkpoint(todel)
            self.checkpoint_queue.append(chkpt_name)
def maybe_save ( self , step ) : if self . keep_checkpoint == 0 : return if step % self . save_checkpoint_steps != 0 : return chkpt , chkpt_name = self . _save ( step ) if self . keep_checkpoint > 0 : if len ( self . checkpoint_queue ) == self . checkpoint_queue . maxlen : todel = self . checkpoint_queue . popleft ( ) self . _rm_checkpoint ( todel ) self . checkpoint_queue . append ( chkpt_name )