docstr: Reloads the state of this flow and its children.
  
  .. code-block:: python
  
  
      class Work(LightningWork):
          def __init__(self):
              super().__init__()
              self.counter = 0
  
          def run(self):
              self.counter += 1
  
  
      class Flow(LightningFlow):
          def run(self):
              # dynamically create a work.
              if not getattr(self, "w", None):
                  self.w = WorkReload()
  
              self.w.run()
  
          def load_state_dict(self, flow_state, children_states, strict) -> None:
              # 1: Re-instantiate the dynamic work
              self.w = Work()
  
              # 2: Make any states modification / migration.
              ...
  
              # 3: Call the parent ``load_state_dict`` to
              # recursively reload the states.
              super().load_state_dict(
                  flow_state,
                  children_states,
                  strict,
              )
  
  Arguments:
      flow_state: The state of the current flow.
      children_states: The state of the dynamic children of this flow.
      strict: Whether to raise an exception if a dynamic
          children hasn't been re-created.
docstr_tok: ["Reloads","the","state","of","this","flow","and","its","children",".","..","code-block",":",":","python","class","Work","(","LightningWork",")",":","def","__init__","(","self",")",":","super","(",")",".__init__","(",")","self.counter","=","0","def","run","(","self",")",":","self.counter","+=","1","class","Flow","(","LightningFlow",")",":","def","run","(","self",")",":","#","dynamically","create","a","work",".","if","not","getattr","(","self",",","``","w","''",",","None",")",":","self.w","=","WorkReload","(",")","self.w.run","(",")","def","load_state_dict","(","self",",","flow_state",",","children_states",",","strict",")","-",">","None",":","#","1",":","Re-instantiate","the","dynamic","work","self.w","=","Work","(",")","#","2",":","Make","any","states","modification","\/","migration",".","...","#","3",":","Call","the","parent","``","load_state_dict","``","to","#","recursively","reload","the","states",".","super","(",")",".load_state_dict","(","flow_state",",","children_states",",","strict",",",")","Arguments",":","flow_state",":","The","state","of","the","current","flow",".","children_states",":","The","state","of","the","dynamic","children","of","this","flow",".","strict",":","Whether","to","raise","an","exception","if","a","dynamic","children","has","n't","been","re-created","."]
code: def load_state_dict(
      self,
      flow_state: Dict[str, Any],
      children_states: Dict[str, Any],
      strict: bool = True,
  ) -> None:
      """Reloads the state of this flow and its children.
  
      .. code-block:: python
  
  
          class Work(LightningWork):
              def __init__(self):
                  super().__init__()
                  self.counter = 0
  
              def run(self):
                  self.counter += 1
  
  
          class Flow(LightningFlow):
              def run(self):
                  # dynamically create a work.
                  if not getattr(self, "w", None):
                      self.w = WorkReload()
  
                  self.w.run()
  
              def load_state_dict(self, flow_state, children_states, strict) -> None:
                  # 1: Re-instantiate the dynamic work
                  self.w = Work()
  
                  # 2: Make any states modification / migration.
                  ...
  
                  # 3: Call the parent ``load_state_dict`` to
                  # recursively reload the states.
                  super().load_state_dict(
                      flow_state,
                      children_states,
                      strict,
                  )
  
      Arguments:
          flow_state: The state of the current flow.
          children_states: The state of the dynamic children of this flow.
          strict: Whether to raise an exception if a dynamic
              children hasn't been re-created.
  
      """
      self.set_state(flow_state, recurse=False)
      direct_children_states = {
          k: v for k, v in children_states.items() if "." not in k
      }
      for child_name, state in direct_children_states.items():
          child = getattr(self, child_name, None)
          if isinstance(child, LightningFlow):
              lower_children_states = {
                  k.replace(child_name + ".", ""): v
                  for k, v in children_states.items()
                  if k.startswith(child_name) and k != child_name
              }
              child.load_state_dict(
                  state, lower_children_states, strict=strict
              )
          elif isinstance(child, LightningWork):
              child.set_state(state)
          elif strict:
              raise ValueError(
                  f"The component {child_name} wasn't instantiated for the component {self.name}"
              )
  
imports: import inspect
  import warnings
  from copy import deepcopy
  from datetime import datetime
  from types import FrameType
  from typing import TYPE_CHECKING, Any, Dict, Generator, Iterable, List, Optional, Tuple, Union, cast
  from deepdiff import DeepHash
  from lightning.app.core.work import LightningWork
  from lightning.app.frontend import Frontend
  from lightning.app.storage.drive import Drive, _maybe_create_drive
  from lightning.app.storage.path import Path
  from lightning.app.utilities.app_helpers import _is_json_serializable, _LightningAppRef, _set_child_name, is_overridden
  from lightning.app.utilities.component import _sanitize_state
  from lightning.app.utilities.exceptions import ExitAppException, LightningFlowException
  from lightning.app.utilities.introspection import _is_init_context, _is_run_context
  from lightning.app.utilities.packaging.cloud_compute import CloudCompute, _maybe_create_cloud_compute
label_desc: Use image node_id 30 for calling the LightningFlow obj's underlying member method code with example usage: obj.load_state_dict(flow_state, children_states, strict) without return types