code: def unscale_with_stashed(
      self,
      model_grads,
      stashed_master_grads,
      master_grads,
      scale_override=None,
  ):
      if self._has_overflow:
          return
  
      grads_have_scale, stashed_have_scale, out_scale = (
          self._loss_scale,
          1.0,
          1.0,
      )
      if scale_override is not None:
          (
              grads_have_scale,
              stashed_have_scale,
              out_scale,
          ) = scale_override
  
      if LossScaler.has_fused_kernel:
          if (
              not LossScaler.warned_unscaling_non_fp32_grad
              and master_grads[0].dtype == torch.float16
          ):
              print(
                  "Warning:  unscaling grads that are not FP32. "
                  "Unscaling non-fp32 grads may indicate an error. "
                  "When using Amp, you don't need to call .half() on your model."
              )
              # Setting this to True unconditionally allows the possibility of an escape
              # if never-before-seen non-fp32 grads are created in some later iteration.
              LossScaler.warned_unscaling_non_fp32_grad = True
          multi_tensor_applier(
              LossScaler.multi_tensor_axpby_cuda,
              self._overflow_buf,
              [model_grads, stashed_master_grads, master_grads],
              out_scale / grads_have_scale,  # 1./scale,
              out_scale / stashed_have_scale,  # 1.0,
              0,
          )  # check only arg 0, aka the incoming model grads, for infs
      else:
          self.unscale_with_stashed_python(
              model_grads,
              stashed_master_grads,
              master_grads,
              out_scale / grads_have_scale,
              out_scale / stashed_have_scale,
          )
  
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 6 for calling the LossScaler obj's underlying member method code with example usage: obj.unscale_with_stashed(model_grads, stashed_master_grads, master_grads, scale_override) without return types