code: def testCategoricalCategoricalKL(self):
      def np_softmax(logits):
          exp_logits = np.exp(logits)
          return exp_logits / exp_logits.sum(axis=-1, keepdims=True)
  
      with self.cached_session() as sess:
          for categories in [2, 4]:
              for batch_size in [1, 10]:
                  a_logits = np.random.randn(batch_size, categories)
                  b_logits = np.random.randn(batch_size, categories)
  
                  a = categorical.Categorical(logits=a_logits)
                  b = categorical.Categorical(logits=b_logits)
  
                  kl = kullback_leibler.kl_divergence(a, b)
                  kl_val = self.evaluate(kl)
                  # Make sure KL(a||a) is 0
                  kl_same = sess.run(
                      kullback_leibler.kl_divergence(a, a)
                  )
  
                  prob_a = np_softmax(a_logits)
                  prob_b = np_softmax(b_logits)
                  kl_expected = np.sum(
                      prob_a * (np.log(prob_a) - np.log(prob_b)),
                      axis=-1,
                  )
  
                  self.assertEqual(kl.get_shape(), (batch_size,))
                  self.assertAllClose(kl_val, kl_expected)
                  self.assertAllClose(
                      kl_same, np.zeros_like(kl_expected)
                  )
  
imports: from absl.testing import parameterized
  import numpy
  from tensorflow.python.eager import backprop
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import tensor_util
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import gradients_impl
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import nn_ops
  from tensorflow.python.ops import random_ops
  from tensorflow.python.ops.distributions import categorical
  from tensorflow.python.ops.distributions import kullback_leibler
  from tensorflow.python.ops.distributions import normal
  from tensorflow.python.platform import test
label_desc: Use image node_id 25 for calling the CategoricalTest obj's underlying member method code with example usage: obj.testCategoricalCategoricalKL() and returns: unknown