code: def kl_divergence(y_true, y_pred):
      """Kullback-Leibler divergence between two probability distributions. A
      vector of probabilities for `y_true`.
  
      Args:
        y_true: tf.Tensor.
          Tensor of real values (probabilities) where the values in each row
          of the outermost dimension sum to 1.
        y_pred: tf.Tensor.
          Same as `y_true`, and with the same shape.
      """
      y_true = tf.cast(y_true, tf.float32)
      y_pred = tf.cast(y_pred, tf.float32)
      zeros = tf.zeros(shape=(tf.shape(y_true)))
      summand = tf.where(
          tf.equal(y_true, 0.0),
          zeros,
          y_true * (tf.log(y_true) - tf.log(y_pred)),
      )
      return tf.reduce_sum(summand)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  import six
  import tensorflow
  from edward.models import RandomVariable
  from edward.util import check_data, get_session, compute_multinomial_mode, with_binary_averaging
label_desc: Use image node_id 9 for calling a global function with example usage: kl_divergence(y_true, y_pred) and returns: tf