@kullback_leibler.RegisterKL(OneHotCategorical, OneHotCategorical)<EOL>def _kl_categorical_categorical(a, b, name=None):
with tf.name_scope(name or "<STR_LIT>"):<EOL><INDENT>return tf.reduce_sum(<EOL>input_tensor=tf.nn.softmax(a.logits) *<EOL>(tf.nn.log_softmax(a.logits) - tf.nn.log_softmax(b.logits)),<EOL>axis=-<NUM_LIT:1>)<EOL><DEDENT>
Calculate the batched KL divergence KL(a || b) with a, b OneHotCategorical.

    Args:
      a: instance of a OneHotCategorical distribution object.
      b: instance of a OneHotCategorical distribution object.
      name: (optional) Name to use for created operations.
        default is "kl_categorical_categorical".

    Returns:
      Batchwise KL(a || b)