def on_train_end(self):
    if self._teardown_already_run:
        return
    self._teardown_already_run = True
    self.trainer.global_step -= 1
    self.check_checkpoint_callback(should_update=True, is_last=True)
    self.trainer.global_step += 1
    self.trainer.call_hook('on_train_end')
    if (self.trainer.logger is not None):
        self.trainer.logger.finalize('success')
    self.trainer.profiler.describe()
    self.trainer.accelerator.on_train_end()
    self.trainer.state.stage = None
def on_train_end(self):
    if self._teardown_already_run:
        return
    self._teardown_already_run = True
    self.trainer.global_step -= 1
    self.check_checkpoint_callback(should_update=True, is_last=True)
    self.trainer.global_step += 1
    self.trainer.call_hook('on_train_end')
    if (self.trainer.logger is not None):
        self.trainer.logger.finalize('success')
    self.trainer.profiler.describe()
    self.trainer.accelerator.on_train_end()
    self.trainer.state.stage = None