class_docstr: Test by comparing TruncatedNormals with wide bounds and unbounded Normal.
    
class_docstr_tok: ["Test","by","comparing","TruncatedNormals","with","wide","bounds","and","unbounded","Normal","."]
code: def testSampling(self, loc, scale):
      n = 1000000
      truncated_dist, normal_dist = self.constructDists(loc, scale)
      seed_stream = test_util.test_seed_stream(salt="TruncNormal")
      truncated_samples = self.evaluate(
          truncated_dist.sample(n, seed=seed_stream())
      ).flatten()
      lb = self.evaluate(truncated_dist.low)
      ub = self.evaluate(truncated_dist.high)
      self.assertAllGreaterEqual(truncated_samples, lb)
      self.assertAllLessEqual(truncated_samples, ub)
  
      normal_samples = self.evaluate(
          normal_dist.sample(n, seed=seed_stream())
      ).flatten()
      # Rejection sample the normal distribution
      rejection_samples = normal_samples[normal_samples >= lb]
      rejection_samples = rejection_samples[rejection_samples <= ub]
  
      self.assertEmpiricalDistributionsEqual(
          truncated_samples, rejection_samples, rtol=1e-2, atol=1e-1
      )
  
imports: import itertools
  import unittest
  from absl.testing import parameterized
  import numpy
  from scipy import stats
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.distributions import truncated_normal
  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 TruncatedNormalTestCompareWithNormal obj's underlying member method code with example usage: obj.testSampling(loc, scale) without return types