code: def _kl_beta_beta(d1, d2, name=None):
      """Calculate the batchwise KL divergence KL(d1 || d2) with d1 and d2 Beta.
  
      Args:
        d1: instance of a Beta distribution object.
        d2: instance of a Beta distribution object.
        name: (optional) Name to use for created operations.
          default is 'kl_beta_beta'.
  
      Returns:
        Batchwise KL(d1 || d2)
      """
      with tf.name_scope(name or "kl_beta_beta"):
          d1_concentration1 = tf.convert_to_tensor(d1.concentration1)
          d1_concentration0 = tf.convert_to_tensor(d1.concentration0)
          d2_concentration1 = tf.convert_to_tensor(d2.concentration1)
          d2_concentration0 = tf.convert_to_tensor(d2.concentration0)
          d1_total_concentration = d1_concentration1 + d1_concentration0
          d2_total_concentration = d2_concentration1 + d2_concentration0
  
          d1_log_normalization = (
              d1._log_normalization(  # pylint: disable=protected-access
                  d1_concentration1, d1_concentration0
              )
          )
          d2_log_normalization = (
              d2._log_normalization(  # pylint: disable=protected-access
                  d2_concentration1, d2_concentration0
              )
          )
          return (
              (d2_log_normalization - d1_log_normalization)
              - (
                  tf.math.digamma(d1_concentration1)
                  * (d2_concentration1 - d1_concentration1)
              )
              - (
                  tf.math.digamma(d1_concentration0)
                  * (d2_concentration0 - d1_concentration0)
              )
              + (
                  tf.math.digamma(d1_total_concentration)
                  * (d2_total_concentration - d1_total_concentration)
              )
          )
  
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import sigmoid
  from tensorflow_probability.python.bijectors import softplus
  from tensorflow_probability.python.distributions import distribution
  from tensorflow_probability.python.distributions import gamma
  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 reparameterization
  from tensorflow_probability.python.internal import samplers
  from tensorflow_probability.python.internal import tensor_util
  from tensorflow_probability.python.math import special
  from tensorflow_probability.python.util.deferred_tensor import DeferredTensor
label_desc: Use image node_id 1 for calling a global function with example usage: _kl_beta_beta(d1, d2, name) and returns: unknown