code: def test_information_bounds(self, scale):
      em = self.get_model(scale=scale, compression=True)
      x, indexes = self.get_samples([200000], scale=2.0 * scale)
      _, bits_eval = em(x, indexes, training=False)
      _, bits_training = em(x, indexes, training=True)
      bits_compressed = 8 * len(em.compress(x, indexes).numpy())
      # Asymptotically, the entropy estimate with `training=True` is an upper
      # bound on the entropy estimate with `training=False`. (With limited data,
      # fluctuations are possible.)
      with self.subTest("training bits > eval bits"):
          # Sample size is too small for the bound to be asymptotic. Increasing it
          # would make tests run too long.
          self.assertGreater(bits_training, 0.99999 * bits_eval)
      # Asymptotically, the length of the bit string should be greater than the
      # entropy estimate with `training=False` because range coding is only
      # asymptotically optimal, and because it operates on quantized
      # probabilities.
      with self.subTest("compressed bits > eval bits"):
          self.assertGreater(bits_compressed, bits_eval)
      # For low entropy distributions, the training bound can be very loose.
      if scale <= 0.5:
          with self.subTest("training bound loose"):
              self.assertAllClose(
                  bits_training, bits_eval, atol=0, rtol=1e-2
              )
              self.assertNotAllClose(
                  bits_training, bits_eval, atol=0, rtol=1e-4
              )
      # For high entropy distributions, the training bound should be tight.
      if scale >= 64:
          with self.subTest("training bound tight"):
              self.assertAllClose(
                  bits_training, bits_eval, atol=0, rtol=1e-5
              )
      # The overhead of range coding should always be manageable.
      with self.subTest("range coding overhead"):
          self.assertAllClose(
              bits_compressed, bits_eval, atol=0, rtol=4e-2
          )
  
imports: from absl.testing import parameterized
  import tensorflow
  import tensorflow_probability
  from tensorflow_compression.python.distributions import uniform_noise
  from tensorflow_compression.python.entropy_models import continuous_indexed
label_desc: Use image node_id 11 for calling the ContinuousIndexedEntropyModelTest obj's underlying member method code with example usage: obj.test_information_bounds(scale) without return types