code: def on_backward_begin(self, last_loss:Rank0Tensor, **kwargs:Any) -> Rank0Tensor:
          "Scale gradients up by `self.loss_scale` to prevent underflow."
          #To avoid gradient underflow, we scale the gradients
          ret_loss = last_loss * self.loss_scale
          return {'last_loss': ret_lossf on_backward_begin(self, last_loss:Rank0Tensor, **kwargs:Any) -> Rank0Tensor:
          "Scale gradients up by `self.loss_scale` to prevent underflow."
          #To avoid gradient underflow, we scale the gradients
          ret_loss = last_loss * self.loss_scale
          return {'last_loss': ret_loss}
docs: Scale gradients up by `self.loss_scale` to prevent underflow.