code: def testQuantizationOfBatchOfUniforms(self):
      batch_shape = (5, 5)
      # The uniforms are supported on [0, 10].  The qdist considers the
      # intervals
      # ... (0, 1](1, 2]...(9, 10]...
      # with the intervals displayed above each holding 1 / 10 of the mass.
      # The qdist will be defined with no cutoffs,
      dist = uniform.Uniform(
          low=tf.zeros(batch_shape, dtype=tf.float32),
          high=10 * tf.ones(batch_shape, dtype=tf.float32),
      )
      qdist = qd.QuantizedDistribution(
          distribution=dist, low=None, high=None, validate_args=True
      )
  
      # x is random integers in {-3,...,12}.
      x = rng.randint(-3, 13, size=batch_shape).astype(np.float32)
  
      # pmf
      # qdist.prob(j) = 1 / 10 for j in {1,...,10}, and 0 otherwise,
      expected_pmf = (1 / 10) * np.ones(batch_shape)
      expected_pmf[x < 1] = 0.0
      expected_pmf[x > 10] = 0.0
      self.assertAllClose(expected_pmf, self.evaluate(qdist.prob(x)))
  
      # cdf
      # qdist.cdf(j)
      #    = 0 for j < 1
      #    = j / 10, for j in {1,...,10},
      #    = 1, for j > 10.
      expected_cdf = x.copy() / 10
      expected_cdf[x < 1] = 0.0
      expected_cdf[x > 10] = 1.0
      self.assertAllClose(expected_cdf, self.evaluate(qdist.cdf(x)))
  
imports: import numpy
  from scipy import stats
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import exponential
  from tensorflow_probability.python.distributions import logistic
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.distributions import quantized_distribution
  from tensorflow_probability.python.distributions import uniform
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math import gradient
label_desc: Use image node_id 3 for calling the QuantizedDistributionTest obj's underlying member method code with example usage: obj.testQuantizationOfBatchOfUniforms() without return types