code: def _kl_gamma_gamma(
      concentration0, rate0, concentration1, rate1, name=None
  ):
      """Calculate batched KL divergence KL(g0 || g1) with given Gamma parameters.
  
      Args:
        concentration0: Concentration of first Gamma distribution (g0).
        rate0: Rate of first Gamma distirbution (g0).
        concentration1: Concentration of second Gamma distribution (g1).
        rate1: Rate of second Gamma distirbution (g1).
        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
          dtype = dtype_util.common_dtype(
              [concentration0, rate0, concentration1, rate1],
              dtype_hint=tf.float32,
          )
          g0_concentration = tf.convert_to_tensor(
              concentration0, dtype=dtype
          )
          g0_rate = tf.convert_to_tensor(rate0, dtype=dtype)
          g1_concentration = tf.convert_to_tensor(
              concentration1, dtype=dtype
          )
          g1_rate = tf.convert_to_tensor(rate1, dtype=dtype)
          return (
              (
                  (g0_concentration - g1_concentration)
                  * tf.math.digamma(g0_concentration)
              )
              + tf.math.lgamma(g1_concentration)
              - tf.math.lgamma(g0_concentration)
              + g1_concentration * tf.math.log(g0_rate)
              - g1_concentration * tf.math.log(g1_rate)
              + g0_concentration * (g1_rate / g0_rate - 1.0)
          )
  
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 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 tensor_util
  from tensorflow_probability.python.math import special
label_desc: Use image node_id 4 for calling a global function with example usage: _kl_gamma_gamma(concentration0, rate0, concentration1, rate1, name) and returns: unknown