code: def test_accurate_predictions_give_small_bitstring_length(self):
      # If we can perfectly predict locations with a very small scale, the
      # bitstring_length should be very small.
      em = universal.UniversalIndexedEntropyModel(
          prior_fn=uniform_noise.NoisyNormal,
          index_ranges=(10, 10),
          parameter_fns=dict(
              loc=lambda i: i[..., 0] / 3.0,
              scale=lambda i: tf.exp(
                  -i[..., 1] - 20
              ),  # Very small scale.
          ),
          coding_rank=1,
          compression=True,
      )
      num_symbols = 1000
      # Random indices in the valid index ranges.
      indexes = tf.cast(
          tf.random.stateless_uniform(
              (3, num_symbols, 16, 2),
              minval=0.0,
              maxval=10.0,
              seed=(0, 0),
          ),
          tf.int32,
      )
      prior = em._make_prior(indexes)
      x = prior.base.sample((), seed=0)
      y = prior.base.sample((), seed=0)
      self.assertAllClose(x, y)
      bitstring = em.compress(x, indexes)
      bitstring_bits = tf.reshape(
          [len(b) * 8 for b in bitstring.numpy().flatten()],
          bitstring.shape,
      )
      # Maximum 2 bytes.
      self.assertAllLessEqual(bitstring_bits, 16.0)
      x_decoded = em.decompress(bitstring, indexes)
      # Maximum error is .5
      self.assertAllLessEqual(tf.abs(x - x_decoded), 0.5)
  
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 4 for calling the UniversalIndexedEntropyModelTest obj's underlying member method code with example usage: obj.test_accurate_predictions_give_small_bitstring_length() without return types