class_docstr: Dynamic loss scaler for AMP.
  
  Properties
  ----------
  loss_scale : float
      The current loss scale
docstr: Check gradients for overflow.
code: def has_overflow(self, params):
      """Check gradients for overflow."""
      if is_np_array():
          all_finite_f = ndarray.numpy._internal.multi_all_finite
          ones_f = lambda ctx: ndarray.numpy.ones((1,), device=ctx)
      else:
          all_finite_f = ndarray.multi_all_finite
          ones_f = lambda ctx: ndarray.ones((1,), ctx=ctx)
      with ag.pause():
          chunk_size = 200
          valid_params = [
              p._grad[0] for p in params if p._grad is not None
          ]
          gpu_output = ones_f(valid_params[0].context)
          nb_params = len(valid_params)
          for idx in range(0, nb_params, chunk_size):
              all_finite_f(
                  *valid_params[idx : idx + chunk_size],
                  num_arrays=len(valid_params[idx : idx + chunk_size]),
                  init_output=False,
                  out=gpu_output,
              )
      has_overflow = not bool(gpu_output.asnumpy())
      self._loss_scale = self._next_loss_scale
      if has_overflow:
          self._next_loss_scale = self._loss_scale / 2.0
          self._unskipped = 0
          logging.info(
              "AMP: decreasing loss scale to %f", self._next_loss_scale
          )
      else:
          self._unskipped += 1
      if self._unskipped == self._scale_seq_len:
          self._unskipped = 0
          self._next_loss_scale = min(
              self._max_loss_scale, self._loss_scale * 2.0
          )
          logging.info(
              "AMP: increasing loss scale to %f", self._next_loss_scale
          )
      return has_overflow
  
file_path: mxnet/python/mxnet/amp/loss_scaler.py
imports: import logging
  from ..None import autograd
  from ..None import ndarray
  from ..util import is_np_array
label_desc: Use image node_id 3 for calling the LossScaler obj's underlying member method code with example usage: obj.has_overflow(params) and returns: has_overflow