code: def testExponentialExponentialKL(self):
      a_rate = np.arange(0.5, 1.6, 0.1)
      b_rate = np.arange(0.5, 1.6, 0.1)
  
      # This reshape is intended to expand the number of test cases.
      a_rate = a_rate.reshape((len(a_rate), 1))
      b_rate = b_rate.reshape((1, len(b_rate)))
  
      a = exponential.Exponential(rate=a_rate, validate_args=True)
      b = exponential.Exponential(rate=b_rate, validate_args=True)
  
      # Consistent with
      # http://www.mast.queensu.ca/~communications/Papers/gil-msc11.pdf, page 108
      true_kl = (
          np.log(a_rate) - np.log(b_rate) + (b_rate - a_rate) / a_rate
      )
  
      kl = kullback_leibler.kl_divergence(a, b)
  
      x = a.sample(int(4e5), 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(true_kl, kl_, atol=0.0, rtol=1e-12)
      self.assertAllMeansClose(
          kl_samples_, true_kl, axis=0, atol=0.0, rtol=8e-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 stats
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import exponential
  from tensorflow_probability.python.distributions import kullback_leibler
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math import gradient
label_desc: Use image node_id 11 for calling the ExponentialTest obj's underlying member method code with example usage: obj.testExponentialExponentialKL() without return types