code: def testLogNormalLogNormalKL(self):
      batch_size = 6
      mu_a = np.array([3.0] * batch_size)
      sigma_a = np.array([1.0, 2.0, 3.0, 1.5, 2.5, 3.5])
      mu_b = np.array([-3.0] * batch_size)
      sigma_b = np.array([0.5, 1.0, 1.5, 2.0, 2.5, 3.0])
  
      ln_a = lognormal.LogNormal(
          loc=mu_a, scale=sigma_a, validate_args=True
      )
      ln_b = lognormal.LogNormal(
          loc=mu_b, scale=sigma_b, validate_args=True
      )
  
      kl = kullback_leibler.kl_divergence(ln_a, ln_b)
      kl_val = self.evaluate(kl)
  
      normal_a = normal.Normal(
          loc=mu_a, scale=sigma_a, validate_args=True
      )
      normal_b = normal.Normal(
          loc=mu_b, scale=sigma_b, validate_args=True
      )
      kl_expected_from_normal = kullback_leibler.kl_divergence(
          normal_a, normal_b
      )
  
      kl_expected_from_formula = (mu_a - mu_b) ** 2 / (
          2 * sigma_b**2
      ) + 0.5 * (
          (sigma_a**2 / sigma_b**2)
          - 1
          - 2 * np.log(sigma_a / sigma_b)
      )
  
      x = ln_a.sample(int(2e5), seed=test_util.test_seed())
      kl_samples = ln_a.log_prob(x) - ln_b.log_prob(x)
      kl_samples_ = self.evaluate(kl_samples)
  
      self.assertEqual(kl.shape, (batch_size,))
      self.assertAllClose(kl_val, kl_expected_from_normal)
      self.assertAllClose(kl_val, kl_expected_from_formula)
      self.assertAllMeansClose(
          kl_samples_,
          kl_expected_from_formula,
          axis=0,
          atol=0.0,
          rtol=1e-2,
      )
  
file_path: probability/tensorflow_probability/python/distributions/lognormal_test.py
imports: import numpy
  from scipy import stats
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import kullback_leibler
  from tensorflow_probability.python.distributions import lognormal
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.internal import test_util
label_desc: Use image node_id 6 for calling the LogNormalTest obj's underlying member method code with example usage: obj.testLogNormalLogNormalKL() without return types