code: def update_scale(self):
      # If the fused kernel is available, we only need one D2H memcopy and sync.
      if (
          LossScaler.has_fused_kernel
          and self.dynamic
          and not self._has_overflow
      ):
          self._has_overflow = self._overflow_buf.item()
  
      if self._has_overflow and self.dynamic:
          should_skip = True
          if self._min_loss_scale:
              self._loss_scale = max(
                  self._min_loss_scale, self._loss_scale / 2.0
              )
          else:
              self._loss_scale = self._loss_scale / 2.0
          self._unskipped = 0
      else:
          should_skip = False
          self._unskipped += 1
  
      if self._unskipped == self._scale_seq_len and self.dynamic:
          self._loss_scale = min(
              self._max_loss_scale, self._loss_scale * 2.0
          )
          self._unskipped = 0
  
      return should_skip
  
file_path: apex/apex/amp/scaler.py
imports: import torch
  from ..multi_tensor_apply import multi_tensor_applier
  from ._amp_state import _amp_state, master_params, maybe_print
  from itertools import product
label_desc: Use image node_id 8 for calling the LossScaler obj's underlying member method code with example usage: obj.update_scale() and returns: should_skip