class_docstr: An instance ``scaler`` helps perform the steps of gradient scaling
  conveniently.
class_docstr_tok: ["An","instance","``","scaler","``","helps","perform","the","steps","of","gradient","scaling","conveniently","."]
code: def state_dict(self) -> Optional[Dict[str, float]]:
      if self.loss_scale is not None:
          return {"loss_scale": self.loss_scale}
      else:
          return None
  
file_path: fairscale/fairscale/experimental/optim/dynamic_loss_scaler.py
imports: from collections import defaultdict
  from enum import Enum
  from typing import Dict, List, Optional
  import torch
label_desc: Use image node_id 9 for calling the DynamicLossScaler obj's underlying member method code with example usage: obj.state_dict() and returns: dict, None