code: def test_docstring_example_normal(self):
      num_draws = int(1e5)
      mu_p = tf.constant(0.0)
      mu_q = tf.constant(1.0)
  
      def exact_kl_normal_normal(mu_p, mu_q):
          p = normal.Normal(loc=mu_p, scale=1.0)
          q = normal.Normal(loc=mu_q, scale=2.0)
          return kullback_leibler.kl_divergence(p, q)
  
      def approximate_kl_normal_normal(mu_p, mu_q):
          p = normal.Normal(loc=mu_p, scale=1.0)
          q = normal.Normal(loc=mu_q, scale=2.0)
          return expectation.expectation(
              f=lambda x: p.log_prob(x) - q.log_prob(x),
              samples=p.sample(num_draws, seed=test_util.test_seed()),
              log_prob=p.log_prob,
              use_reparameterization=(
                  p.reparameterization_type
                  == reparameterization.FULLY_REPARAMETERIZED
              ),
          )
  
      approx_kl_, approx_kl_grad = gradient.value_and_gradient(
          approximate_kl_normal_normal, mu_p, mu_q
      )
      exact_kl_, exact_kl_grad = gradient.value_and_gradient(
          exact_kl_normal_normal, mu_p, mu_q
      )
  
      self.assertAllClose(exact_kl_, approx_kl_, rtol=0.01, atol=0.0)
  
      # Compare gradients. (Not present in `docstring`.)
      self.assertAllCloseNested(
          exact_kl_grad, approx_kl_grad, rtol=0.01, atol=0.0
      )
  
imports: import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import bernoulli
  from tensorflow_probability.python.distributions import joint_distribution_named
  from tensorflow_probability.python.distributions import kullback_leibler
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.internal import reparameterization
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.internal.monte_carlo import _get_samples
  from tensorflow_probability.python.math import gradient
  from tensorflow_probability.python.monte_carlo import expectation
label_desc: Use image node_id 2 for calling the ExpectationTest obj's underlying member method code with example usage: obj.test_docstring_example_normal() and returns: kullback_leibler, expectation