code: def test_kl_divergence(self):
      d0 = jdn.JointDistributionNamed(
          dict(
              e=independent.Independent(
                  exponential.Exponential(rate=[100, 120]), 1
              ),
              x=normal.Normal(loc=0, scale=2.0),
          ),
          validate_args=True,
      )
      d1 = jdn.JointDistributionNamed(
          dict(
              e=independent.Independent(
                  exponential.Exponential(rate=[10, 12]), 1
              ),
              x=normal.Normal(loc=1, scale=1.0),
          ),
          validate_args=True,
      )
      self.assertEqual(d0.model.keys(), d1.model.keys())
      expected_kl = sum(
          kullback_leibler.kl_divergence(d0.model[k], d1.model[k])
          for k in d0.model.keys()
      )
      actual_kl = kullback_leibler.kl_divergence(d0, d1)
      other_actual_kl = d0.kl_divergence(d1)
      expected_kl_, actual_kl_, other_actual_kl_ = self.evaluate(
          [expected_kl, actual_kl, other_actual_kl]
      )
      self.assertNear(expected_kl_, actual_kl_, err=1e-5)
      self.assertNear(expected_kl_, other_actual_kl_, err=1e-5)
  
imports: import collections
  from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import bijector_test_util
  from tensorflow_probability.python.bijectors import scale
  from tensorflow_probability.python.distributions import bernoulli
  from tensorflow_probability.python.distributions import beta
  from tensorflow_probability.python.distributions import exponential
  from tensorflow_probability.python.distributions import gamma
  from tensorflow_probability.python.distributions import half_normal
  from tensorflow_probability.python.distributions import independent
  from tensorflow_probability.python.distributions import joint_distribution_named
  from tensorflow_probability.python.distributions import joint_distribution_sequential
  from tensorflow_probability.python.distributions import kullback_leibler
  from tensorflow_probability.python.distributions import lognormal
  from tensorflow_probability.python.distributions import mvn_diag
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.distributions import sample
  from tensorflow_probability.python.distributions import student_t
  from tensorflow_probability.python.distributions import transformed_distribution
  from tensorflow_probability.python.internal import test_util
label_desc: Use image node_id 8 for calling the JointDistributionNamedTest obj's underlying member method code with example usage: obj.test_kl_divergence() without return types