keras/src/optimizers/loss_scale_optimizer.py/LossScaleOptimizer/scale_loss
class LossScaleOptimizer:    def scale_loss(self, loss):
        scale = self.dynamic_scale if self.built else self.initial_scale
        return loss * scale