code: def testSamplingFromBatchOfNormals(self):
      batch_shape = (2,)
      dist = normal.Normal(
          loc=tf.zeros(batch_shape, dtype=tf.float32),
          scale=tf.ones(batch_shape, dtype=tf.float32),
      )
  
      qdist = qd.QuantizedDistribution(
          distribution=dist, low=0.0, high=None, validate_args=True
      )
  
      samps = qdist.sample(5000, seed=test_util.test_seed())
      samps_v = self.evaluate(samps)
  
      # With low = 0, the interval j=0 is (-infty, 0], which holds 1/2
      # of the mass of the normals.
      #
      # NOTE: rtol chosen to be ~5 standard deviations from the expected value,
      # to give a false positive rate of ~1e-6.
      self.assertAllClose(
          [0.5, 0.5], (samps_v == 0).mean(axis=0), rtol=0.071
      )
  
      # The interval j=1 is (0, 1], which is from the mean to one standard
      # deviation out.  This should contain 0.6827 / 2 of the mass.
      #
      # NOTE: rtol chosen to be ~5 standard deviations from the expected value,
      # to give a false positive rate of ~1e-6.
      self.assertAllClose(
          [0.6827 / 2, 0.6827 / 2],
          (samps_v == 1).mean(axis=0),
          rtol=0.098,
      )
  
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 4 for calling the QuantizedDistributionTest obj's underlying member method code with example usage: obj.testSamplingFromBatchOfNormals() without return types