code: def testChiChiKL(self):
      # We make sure a_df and b_df don't have any overlap. If this is not done,
      # then the check for true_kl vs kl_sample_ ends up failing because the
      # true_kl is zero and the sample is nonzero (though very small).
      a_df = np.arange(1, 6, step=2, dtype=np.float64)
      b_df = np.arange(2, 7, step=2, dtype=np.float64)
  
      a_df = a_df.reshape((len(a_df), 1))
      b_df = b_df.reshape((1, len(b_df)))
  
      a = chi.Chi(df=a_df, validate_args=True)
      b = chi.Chi(df=b_df, validate_args=True)
  
      true_kl = (
          0.5 * special.digamma(0.5 * a_df) * (a_df - b_df)
          + special.gammaln(0.5 * b_df)
          - special.gammaln(0.5 * a_df)
      )
  
      kl = kullback_leibler.kl_divergence(a, b)
  
      x = a.sample(int(8e5), seed=test_util.test_seed())
      kl_samples = a.log_prob(x) - b.log_prob(x)
  
      kl_, kl_samples_ = self.evaluate([kl, kl_samples])
      self.assertAllClose(kl_, true_kl, atol=0.0, rtol=1e-12)
      self.assertAllMeansClose(
          kl_samples_, true_kl, axis=0, atol=0.0, rtol=5e-2
      )
  
      zero_kl = kullback_leibler.kl_divergence(a, a)
      true_zero_kl_, zero_kl_ = self.evaluate(
          [tf.zeros_like(zero_kl), zero_kl]
      )
      self.assertAllEqual(true_zero_kl_, zero_kl_)
  
imports: import numpy
  from scipy import special
  from scipy import stats
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import chi
  from tensorflow_probability.python.distributions import kullback_leibler
  from tensorflow_probability.python.internal import test_util
label_desc: Use image node_id 8 for calling the ChiTest obj's underlying member method code with example usage: obj.testChiChiKL() without return types