code: def test_basic(self):
      loss_scale_value = 1000
      loss_scale = loss_scale_module.FixedLossScale(loss_scale_value)
  
      update_op, should_apply = loss_scale.update(
          [constant_op.constant(0.0)]
      )
      self.evaluate(update_op)
      # should_apply should be a bool instead of a tensor, so that a tf.cond does
      # not have to be built in the graph by the caller.
      self.assertIsInstance(should_apply, bool)
      self.assertTrue(should_apply)
      self.assertEqual(loss_scale_value, self.evaluate(loss_scale()))
  
      update_op, should_apply = loss_scale.update(
          [constant_op.constant(float("NaN"))]
      )
      self.evaluate(update_op)
      self.assertIsInstance(should_apply, bool)
      self.assertTrue(should_apply)
      self.assertEqual(loss_scale_value, self.evaluate(loss_scale()))
  
imports: from absl.testing import parameterized
  import numpy
  from tensorflow.python.data.ops import dataset_ops
  from tensorflow.python.distribute import distribute_lib
  from tensorflow.python.distribute import mirrored_strategy
  from tensorflow.python.eager import context
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import check_ops
  from tensorflow.python.ops import cond
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import variables
  from tensorflow.python.platform import test
  from tensorflow.python.training.experimental import loss_scale
label_desc: Use image node_id 1 for calling the FixedLossScaleTest obj's underlying member method code with example usage: obj.test_basic() without return types