code: def testInverseGammaSampleMultiDimensional(self):
      alpha_v = np.array(
          [np.arange(5, 105, dtype=np.float32)]
      )  # 1 x 100
      beta_v = np.array(
          [np.arange(1, 11, dtype=np.float32)]
      ).T  # 10 x 1
      inv_gamma = inverse_gamma.InverseGamma(
          concentration=alpha_v, scale=beta_v, validate_args=True
      )
      n = int(1e5)
      samples = inv_gamma.sample(n, seed=test_util.test_seed())
      sample_values = self.evaluate(samples)
      self.assertEqual(samples.shape, (n, 10, 100))
      self.assertEqual(sample_values.shape, (n, 10, 100))
      zeros = np.zeros_like(alpha_v + beta_v)  # 10 x 100
      alpha_bc = alpha_v + zeros
      beta_bc = beta_v + zeros
      self.assertAllClose(
          sample_values.mean(axis=0),
          stats.invgamma.mean(alpha_bc, scale=beta_bc),
          atol=0.25,
      )
      self.assertAllClose(
          sample_values.var(axis=0),
          stats.invgamma.var(alpha_bc, scale=beta_bc),
          atol=4.5,
      )
      fails = 0
      trials = 0
      for ai, a in enumerate(np.reshape(alpha_v, [-1])):
          for bi, b in enumerate(np.reshape(beta_v, [-1])):
              s = sample_values[:, bi, ai]
              trials += 1
              fails += 0 if self._kstest(a, b, s) else 1
      self.assertLess(fails, trials * 0.03)
  
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 17 for calling the InverseGammaTest obj's underlying member method code with example usage: obj.testInverseGammaSampleMultiDimensional() without return types