class_docstr: Basic Loops interface.
docstr: The state dict is determined by the state and progress of this loop and all its children.
  
  Args:
      destination: An existing dictionary to update with this loop's state. By default a new dictionary
          is returned.
      prefix: A prefix for each key in the state dictionary
code: def state_dict(
      self, destination: Optional[Dict] = None, prefix: str = ""
  ) -> Dict:
      """The state dict is determined by the state and progress of this loop and all its children.
  
      Args:
          destination: An existing dictionary to update with this loop's state. By default a new dictionary
              is returned.
          prefix: A prefix for each key in the state dictionary
  
      """
      if destination is None:
          destination = {}
  
      destination[prefix + "state_dict"] = self.on_save_checkpoint()
  
      for k, v in self.__dict__.items():
          key = prefix + k
          if isinstance(v, _BaseProgress):
              destination[key] = v.state_dict()
          elif isinstance(v, _Loop):
              v.state_dict(destination, key + ".")
      return destination
  
file_path: pytorch-lightning/src/lightning/pytorch/loops/loop.py
imports: from typing import Dict, Optional
  import lightning.pytorch
  from lightning.pytorch.loops.progress import _BaseProgress
label_desc: Use image node_id 6 for calling the _Loop obj's underlying member method code with example usage: obj.state_dict(destination, prefix) and returns: destination