code: def testSampleGammaLogSpace(self):
      concentration = np.linspace(0.1, 2.0, 10)
      rate = np.linspace(0.5, 2, 10)
      np.random.shuffle(rate)
      num_samples = int(1e5)
      self.assertLess(
          self.evaluate(
              st.min_num_samples_for_dkwm_cdf_test(
                  discrepancy=0.04,
                  false_fail_rate=1e-9,
                  false_pass_rate=1e-9,
              )
          ),
          num_samples,
      )
  
      samples = gamma_lib.random_gamma(
          [num_samples],
          concentration,
          rate,
          seed=test_util.test_seed(),
          log_space=True,
      )
  
      exp_gamma = tfb.Log()(
          gamma_lib.Gamma(
              concentration=concentration, rate=rate, validate_args=True
          )
      )
      self.evaluate(
          st.assert_true_cdf_equal_by_dkwm(
              samples, exp_gamma.cdf, false_fail_rate=1e-9
          )
      )
  
      self.assertAllClose(
          self.evaluate(tf.math.reduce_mean(samples, axis=0)),
          tf.math.digamma(concentration) - tf.math.log(rate),
          rtol=0.02,
          atol=0.01,
      )
      self.assertAllClose(
          self.evaluate(tf.math.reduce_variance(samples, axis=0)),
          tf.math.polygamma(1.0, concentration),
          rtol=0.05,
      )
  
imports: import functools
  from absl.testing import parameterized
  import numpy
  from scipy import misc
  from scipy import special
  from scipy import stats
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import exp
  from tensorflow_probability.python.distributions import gamma
  from tensorflow_probability.python.distributions import kullback_leibler
  from tensorflow_probability.python.distributions.internal import statistical_testing
  from tensorflow_probability.python.internal import implementation_selection
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math import gradient
label_desc: Use image node_id 7 for calling the GammaSamplingTest obj's underlying member method code with example usage: obj.testSampleGammaLogSpace() without return types