code: def testQuantizationOfUniformWithCutoffsHavingNoEffect(self):
      # The Quantized uniform with cutoffs == None divides the real line into:
      # R = ...(-1, 0](0, 1](1, 2](2, 3](3, 4]...
      # j = ...     0     1     2     3     4 ...
      # Since this uniform (below) is supported on [0, 3],
      # it places 1/3 of its mass in the intervals j = 1, 2, 3.
      # Adding a cutoff at y = 0 changes the picture to
      # R = ...(-inf, 0](0, 1](1, 2](2, 3](3, 4]...
      # j = ...     0     1     2     3     4 ...
      # So the QUniform still places 1/3 of its mass in the intervals
      # j = 1, 2, 3.
      # Adding a cutoff at y = 3 changes the picture to
      # R = ...(-1, 0](0, 1](1, 2](2, inf)
      # j = ...     0     1     2     3
      # and the QUniform still places 1/3 of its mass in the intervals
      # j = 1, 2, 3.
      for lcut, ucut in [
          (None, None),
          (0.0, None),
          (None, 3.0),
          (0.0, 3.0),
          (-10.0, 10.0),
      ]:
          qdist = qd.QuantizedDistribution(
              distribution=uniform.Uniform(low=0.0, high=3.0),
              low=lcut,
              high=ucut,
              validate_args=False,
          )
  
          # pmf
          (
              pmf_n1,
              pmf_0,
              pmf_1,
              pmf_2,
              pmf_3,
              pmf_4,
              pmf_5,
          ) = self.evaluate(
              qdist.prob([-1.0, 0.0, 1.0, 2.0, 3.0, 4.0, 5.0])
          )
          # uniform had no mass below -1.
          self.assertAllClose(0.0, pmf_n1)
          # uniform had no mass below 0.
          self.assertAllClose(0.0, pmf_0)
          # uniform put 1/3 of its mass in each of (0, 1], (1, 2], (2, 3],
          # which are the intervals j = 1, 2, 3.
          self.assertAllClose(1 / 3, pmf_1)
          self.assertAllClose(1 / 3, pmf_2)
          self.assertAllClose(1 / 3, pmf_3)
          # uniform had no mass in (3, 4] or (4, 5], which are j = 4, 5.
          self.assertAllClose(0 / 3, pmf_4)
          self.assertAllClose(0 / 3, pmf_5)
  
          # cdf
          (
              cdf_n1,
              cdf_0,
              cdf_1,
              cdf_2,
              cdf_2p5,
              cdf_3,
              cdf_4,
              cdf_5,
          ) = self.evaluate(
              qdist.cdf([-1.0, 0.0, 1.0, 2.0, 2.5, 3.0, 4.0, 5.0])
          )
          self.assertAllClose(0.0, cdf_n1)
          self.assertAllClose(0.0, cdf_0)
          self.assertAllClose(1 / 3, cdf_1)
          self.assertAllClose(2 / 3, cdf_2)
          # Note fractional values allowed for cdfs of discrete distributions.
          # And adding 0.5 makes no difference because the quantized dist has
          # mass only on the integers, never in between.
          self.assertAllClose(2 / 3, cdf_2p5)
          self.assertAllClose(3 / 3, cdf_3)
          self.assertAllClose(3 / 3, cdf_4)
          self.assertAllClose(3 / 3, cdf_5)
  
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 1 for calling the QuantizedDistributionTest obj's underlying member method code with example usage: obj.testQuantizationOfUniformWithCutoffsHavingNoEffect() without return types