code: def test_quantization_noise_is_uniform(self, scale):
      em = universal.UniversalIndexedEntropyModel(
          prior_fn=uniform_noise.NoisyNormal,
          index_ranges=(10, 10),
          parameter_fns=dict(
              loc=lambda i: (i[..., 0] - 5.0) / 10.0,
              scale=lambda i: scale * tf.exp(-i[..., 1]),
          ),
          coding_rank=1,
          compression=True,
      )
      num_symbols = 10000
      # Source distribution is gaussian with stddev `scale`.
      x = tf.random.stateless_normal(
          (1, 1, num_symbols), stddev=scale, seed=(0, 0)
      )
      # We predict the distribution correctly.
      indexes = tf.concat(
          (
              5 * tf.ones((1, 1, num_symbols, 1)),
              0 * tf.ones((1, 1, num_symbols, 1)),
          ),
          axis=-1,
      )
      bitstring = em.compress(x, indexes)
      x_hat = em.decompress(bitstring, indexes)
      # Quantization noise should be between -.5 and .5
      u = x - x_hat
      self.assertAllLessEqual(tf.abs(u), 0.5)
      # Check distribution has right statistics.
      _, p = scipy.stats.kstest(
          tf.reshape(u, [-1]), "uniform", (-0.5, 1.0)
      )
      self.assertGreater(p, 1e-6)
  
imports: from absl.testing import parameterized
  import scipy.stats
  import tensorflow
  import tensorflow_probability
  from tensorflow_compression.python.distributions import deep_factorized
  from tensorflow_compression.python.distributions import uniform_noise
  from tensorflow_compression.python.entropy_models import universal
label_desc: Use image node_id 12 for calling the UniversalIndexedEntropyModelTest obj's underlying member method code with example usage: obj.test_quantization_noise_is_uniform(scale) without return types