code: def testGammaGammaKL(self):
      alpha0 = np.array([3.0])
      beta0 = np.array([1.0, 2.0, 3.0, 1.5, 2.5, 3.5])
  
      alpha1 = np.array([0.4])
      beta1 = np.array([0.5, 1.0, 1.5, 2.0, 2.5, 3.0])
  
      # Build graph.
      g0 = gamma_lib.Gamma(concentration=alpha0, rate=beta0)
      g1 = gamma_lib.Gamma(concentration=alpha1, rate=beta1)
      x = g0.sample(int(1e4), seed=0)
      kl_sample = math_ops.reduce_mean(
          g0.log_prob(x) - g1.log_prob(x), 0
      )
      kl_actual = kullback_leibler.kl_divergence(g0, g1)
  
      # Execute graph.
      [kl_sample_, kl_actual_] = self.evaluate([kl_sample, kl_actual])
  
      self.assertEqual(beta0.shape, kl_actual.get_shape())
  
      if not special:
          return
      kl_expected = (
          (alpha0 - alpha1) * special.digamma(alpha0)
          + special.gammaln(alpha1)
          - special.gammaln(alpha0)
          + alpha1 * np.log(beta0)
          - alpha1 * np.log(beta1)
          + alpha0 * (beta1 / beta0 - 1.0)
      )
  
      self.assertAllClose(kl_expected, kl_actual_, atol=0.0, rtol=1e-6)
      self.assertAllClose(kl_sample_, kl_actual_, atol=0.0, rtol=1e-1)
  
imports: import importlib
  import numpy
  from tensorflow.python.eager import backprop
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import tensor_shape
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import nn_ops
  from tensorflow.python.ops.distributions import gamma
  from tensorflow.python.ops.distributions import kullback_leibler
  from tensorflow.python.platform import test
  from tensorflow.python.platform import tf_logging
label_desc: Use image node_id 23 for calling the GammaTest obj's underlying member method code with example usage: obj.testGammaGammaKL() without return types