docstr: Load an optimizer state dict.
  
  In general we should prefer the configuration of the existing optimizer
  instance (e.g., learning rate) over that found in the state_dict. This
  allows us to resume training from a checkpoint using a new set of
  optimizer args.
docstr_tok: ["Load","an","optimizer","state","dict",".","In","general","we","should","prefer","the","configuration","of","the","existing","optimizer","instance","(","e.g.",",","learning","rate",")","over","that","found","in","the","state_dict",".","This","allows","us","to","resume","training","from","a","checkpoint","using","a","new","set","of","optimizer","args","."]
code: def load_state_dict(self, state_dict, optimizer_overrides=None):
      """Load an optimizer state dict.
  
      In general we should prefer the configuration of the existing optimizer
      instance (e.g., learning rate) over that found in the state_dict. This
      allows us to resume training from a checkpoint using a new set of
      optimizer args.
      """
      if "loss_scale" in state_dict and self.scaler is not None:
          self.scaler.loss_scale = state_dict["loss_scale"]
      self.fp32_optimizer.load_state_dict(
          state_dict, optimizer_overrides
      )
  
imports: from collections import defaultdict
  from itertools import chain
  import torch
  from omegaconf import DictConfig
  from fairseq import optim
  from .dynamic_loss_scaler import DynamicLossScaler
label_desc: Use image node_id 5 for calling the _FP16OptimizerMixin obj's underlying member method code with example usage: obj.load_state_dict(state_dict, optimizer_overrides) without return types