code: def _kl_ordered_logistic_ordered_logistic(a, b, name=None):
      """Calculate the batched KL divergence KL(a || b), a and b OrderedLogistic.
  
      This function utilises the `OrderedLogistic` `categorical_log_probs` member
      function to implement KL divergence for discrete probability distributions as
      described in
      e.g. [Wikipedia](https://en.wikipedia.org/wiki/Kullback-Leibler_divergence).
  
      Args:
        a: instance of a OrderedLogistic distribution object.
        b: instance of a OrderedLogistic distribution object.
        name: Python `str` name to use for created operations.
          Default value: `None` (i.e., `'kl_ordered_logistic_ordered_logistic'`).
  
      Returns:
        Batchwise KL(a || b)
      """
      with tf.name_scope(
          name or "kl_ordered_logistic_ordered_logistic"
      ):
          a_log_probs = a.categorical_log_probs()
          b_log_probs = b.categorical_log_probs()
          return tf.reduce_sum(
              tf.math.multiply_no_nan(
                  a_log_probs - b_log_probs, tf.math.exp(a_log_probs)
              ),
              axis=-1,
          )
  
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import ascending
  from tensorflow_probability.python.distributions import categorical
  from tensorflow_probability.python.distributions import distribution
  from tensorflow_probability.python.distributions import kullback_leibler
  from tensorflow_probability.python.internal import assert_util
  from tensorflow_probability.python.internal import distribution_util
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import parameter_properties
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import reparameterization
  from tensorflow_probability.python.internal import tensor_util
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.math import generic
label_desc: Use image node_id 1 for calling a global function with example usage: _kl_ordered_logistic_ordered_logistic(a, b, name) and returns: tf