code: def test_gradients_are_straight_through(self):
      em = PowerLawEntropyModel(coding_rank=1)
      x = tf.range(-20.0, 20.0)
      x_perturbed = x + tf.random.uniform(x.shape, -0.49, 0.49)
      with tf.GradientTape() as tape:
          tape.watch(x_perturbed)
          x_quantized = em.quantize(x_perturbed)
      gradients = tape.gradient(x_quantized, x_perturbed)
      self.assertAllEqual(gradients, tf.ones_like(gradients))
  
file_path: compression/tensorflow_compression/python/entropy_models/power_law_test.py
imports: import numpy
  import tensorflow
  from tensorflow_compression.python.entropy_models.power_law import PowerLawEntropyModel
label_desc: Use image node_id 4 for calling the PowerLawEntropyModelTest obj's underlying member method code with example usage: obj.test_gradients_are_straight_through() without return types