docstr: Restore the trainer state from the pre-loaded checkpoint.
  
  This includes the precision settings, loop progress, optimizer states and learning rate scheduler states.
docstr_tok: ["Restore","the","trainer","state","from","the","pre-loaded","checkpoint",".","This","includes","the","precision","settings",",","loop","progress",",","optimizer","states","and","learning","rate","scheduler","states","."]
code: def restore_training_state(self) -> None:
      """Restore the trainer state from the pre-loaded checkpoint.
  
      This includes the precision settings, loop progress, optimizer states and learning rate scheduler states.
  
      """
      if not self._loaded_checkpoint:
          return
  
      # restore precision plugin (scaler etc.)
      self.restore_precision_plugin_state()
  
      # restore loops and their progress
      self.restore_loops()
  
      assert self.trainer.state.fn is not None
      if self.trainer.state.fn == TrainerFn.FITTING:
          # restore optimizers and schedulers state
          self.restore_optimizers_and_schedulers()
  
imports: import logging
  import os
  import re
  from typing import Any, Dict, Optional
  import torch
  from fsspec.core import url_to_fs
  from fsspec.implementations.local import LocalFileSystem
  from torch import Tensor
  import lightning.pytorch
  from lightning.fabric.plugins.environments.slurm import SLURMEnvironment
  from lightning.fabric.utilities.cloud_io import _is_dir, get_filesystem
  from lightning.fabric.utilities.types import _PATH
  from lightning.pytorch.callbacks import ModelCheckpoint
  from lightning.pytorch.plugins.precision import MixedPrecision
  from lightning.pytorch.trainer import call
  from lightning.pytorch.trainer.states import TrainerFn
  from lightning.pytorch.utilities.exceptions import MisconfigurationException
  from lightning.pytorch.utilities.imports import _OMEGACONF_AVAILABLE
  from lightning.pytorch.utilities.migration import pl_legacy_patch
  from lightning.pytorch.utilities.migration.utils import _pl_migrate_checkpoint
  from lightning.pytorch.utilities.rank_zero import rank_zero_info, rank_zero_warn
label_desc: Use image node_id 10 for calling the _CheckpointConnector obj's underlying member method code with example usage: obj.restore_training_state() without return types