                  logger.debug("Save Iteration: (iteration: %s", iteration)
                  model.save()
              elif self._save_now:
                  logger.debug("Save Requested: (iteration: %s", iteration)
                  model.save()
                  self._save_now = False
          logger.debug("Training cycle complete")
          model.save()
          trainer.clear_tensorboard()
          self._stop = True
 
</s> remove                 model.save()
 </s> add                 model.save(is_exit=False) </s> remove         model.save()
 </s> add         model.save(is_exit=True) </s> remove     def _monitor(self, thread):
        """ Monitor the background :func:`_training` thread for key presses and errors.

        Returns
        -------
        bool
            ``True`` if there has been an error in the background thread otherwise ``False``
        """
 </s> add     def _output_startup_info(self):
        """ Print the startup information to the console. """ </s> remove                 model.save()
 </s> add                 model.save(on_exit=True)
                model.save(is_exit=False)
                  logger.debug("Save Iteration: (iteration: %s", iteration)
                  model.save()
              elif self._save_now:
                  logger.debug("Save Requested: (iteration: %s", iteration)
                model.save(is_exit=False)
                  self._save_now = False
          logger.debug("Training cycle complete")
          model.save()
          trainer.clear_tensorboard()
          self._stop = True
keep keep keep keep replace keep keep keep keep keep
 Training: Add setting option to save optimizer weights 
scripts/train.py