code: def test_downscaling(self, stateless):
      self._skip_test_for_stateless(stateless)
  
      inner_optimizer = SGD(learning_rate=0.5)
      optimizer = LossScaleOptimizer(
          inner_optimizer, initial_scale=400.0
      )
      vars = [backend.Variable([1.0, 2.0, 3.0, 4.0])]
      optimizer.build(vars)
      opt_vars = optimizer.variables
      grads = [ops.array([np.inf, np.inf, np.inf, np.inf])]
      for _ in range(4):
          if stateless:
              _, opt_vars = optimizer.stateless_apply(
                  opt_vars, grads, vars
              )
              for ref_v, v in zip(optimizer.variables, opt_vars):
                  ref_v.assign(v)
          else:
              optimizer.apply(grads, vars)
      self.assertAllClose(optimizer.scale_loss(1.0), 25.0)
  
file_path: keras/keras/optimizers/loss_scale_optimizer_test.py
imports: import numpy
  from absl.testing import parameterized
  from keras import backend
  from keras import ops
  from keras import testing
  from keras.optimizers.loss_scale_optimizer import LossScaleOptimizer
  from keras.optimizers.sgd import SGD
label_desc: Use image node_id 5 for calling the LossScaleOptimizerTest obj's underlying member method code with example usage: obj.test_downscaling(stateless) without return types