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","."]
docstr: Updates the scale factor.
docstr_tok: ["Updates","the","scale","factor","."]
code: def update(self) -> None:
      """Updates the scale factor."""
  
      if (
          self._iter - self._last_overflow_iter
      ) % self.scale_window == 0:
          self.loss_scale *= self.scale_factor
          self._last_rescale_iter = self._iter
      self._iter += 1
      self._per_optimizer_states = defaultdict(
          _refresh_per_optimizer_state
      )
  
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 6 for calling the DynamicLossScaler obj's underlying member method code with example usage: obj.update() without return types