code: def testInverseGammaSample(self):
      alpha_v = 4.0
      beta_v = 3.0
      alpha = tf.constant(alpha_v)
      beta = tf.constant(beta_v)
      n = int(5e5)
      inv_gamma = inverse_gamma.InverseGamma(
          concentration=alpha, scale=beta, validate_args=True
      )
      samples = inv_gamma.sample(
          n, seed=test_util.test_seed(hardcoded_seed=137)
      )
      sample_values = self.evaluate(samples)
      self.assertEqual(samples.shape, (n,))
      self.assertEqual(sample_values.shape, (n,))
      self.assertAllClose(
          sample_values.mean(),
          stats.invgamma.mean(alpha_v, scale=beta_v),
          atol=0.0040,
      )
      self.assertAllClose(
          sample_values.var(),
          stats.invgamma.var(alpha_v, scale=beta_v),
          atol=0.15,
      )
      self.assertTrue(self._kstest(alpha_v, beta_v, sample_values))
  
imports: import numpy
  from scipy import stats
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import inverse_gamma
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math import gradient
label_desc: Use image node_id 15 for calling the InverseGammaTest obj's underlying member method code with example usage: obj.testInverseGammaSample() without return types