code: def update_scale(self, overflow):
      if overflow:
          self.cur_scale /= self.scale_factor
          self.last_overflow_iter = self.cur_iter
      else:
          if (
              self.cur_iter - self.last_overflow_iter
          ) % self.scale_window == 0:
              self.cur_scale *= self.scale_factor
  
      self.cur_iter += 1
  
imports: import torch
  import torch.nn
  from torch._utils import _flatten_dense_tensors, _unflatten_dense_tensors
label_desc: Use image node_id 4 for calling the DynamicLossScaler obj's underlying member method code with example usage: obj.update_scale(overflow) without return types