class_docstr: Loads and extracts the state of an :class:`Optimizer` managed by FSDP.
class_docstr_tok: ["Loads","and","extracts","the","state","of","an",":","class",":","`","Optimizer","`","managed","by","FSDP","."]
code: def load_state(self, stateful: Optimizer, state: Any) -> None:
      state_dict = FSDP.optim_state_dict_to_load(
          self.module, stateful, state
      )
  
      stateful.load_state_dict(state_dict)
  
imports: from __future__ import annotations
  from abc import ABC, abstractmethod
  from typing import Any, Dict, Mapping, Optional, Protocol, Tuple, final, runtime_checkable
  from torch.distributed.fsdp import FullyShardedDataParallel
  from torch.nn import Module
  from torch.optim import Optimizer
  from fairseq2.typing import finaloverride
label_desc: Use image node_id 2 for calling the FSDPOptimizerStateHandler obj's underlying member method code with example usage: obj.load_state(stateful, state) without return types