code: def update_scale(self, overflow):
      if overflow:
          # self.cur_scale /= self.scale_factor
          self.cur_scale = max(self.cur_scale / self.scale_factor, 1)
          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_scale = 1
      self.cur_iter += 1
  
file_path: DALI/docs/examples/use_cases/video_superres/common/loss_scaler.py
imports: import torch
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