code: def kl_gamma_gamma(g0, g1, name=None):
      """Calculate the batched KL divergence KL(g0 || g1) with g0 and g1 Gamma.
  
      Args:
        g0: Instance of a `Gamma` distribution object.
        g1: Instance of a `Gamma` distribution object.
        name: Python `str` name to use for created operations.
          Default value: `None` (i.e., `'kl_gamma_gamma'`).
  
      Returns:
        kl_gamma_gamma: `Tensor`. The batchwise KL(g0 || g1).
      """
      with tf.name_scope(name or "kl_gamma_gamma"):
          # Result from:
          #   http://www.fil.ion.ucl.ac.uk/~wpenny/publications/densities.ps
          # For derivation see:
          #   http://stats.stackexchange.com/questions/11646/kullback-leibler-divergence-between-two-gamma-distributions   pylint: disable=line-too-long
          g0_concentration = tf.convert_to_tensor(g0.concentration)
          g0_log_rate = (
              g0._log_rate_parameter()
          )  # pylint: disable=protected-access
          g1_concentration = tf.convert_to_tensor(g1.concentration)
          g1_log_rate = (
              g1._log_rate_parameter()
          )  # pylint: disable=protected-access
          return (
              (
                  (g0_concentration - g1_concentration)
                  * tf.math.digamma(g0_concentration)
              )
              + tf.math.lgamma(g1_concentration)
              - tf.math.lgamma(g0_concentration)
              + g1_concentration * g0_log_rate
              - g1_concentration * g1_log_rate
              + g0_concentration
              * tf.math.expm1(g1_log_rate - g0_log_rate)
          )
  
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import softplus
  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 batched_rejection_sampler
  from tensorflow_probability.python.internal import custom_gradient
  from tensorflow_probability.python.internal import distribution_util
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import implementation_selection
  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 samplers
  from tensorflow_probability.python.internal import tensor_util
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.math import generic
  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_gamma_gamma(g0, g1, name) and returns: unknown