code: def _kl_uniform_uniform(a, b, name=None):
      """Calculate the batched KL divergence KL(a || b) with a and b Uniform.
  
      Note that the KL divergence is infinite if the support of `a` is not a subset
      of the support of `b`.
  
      Args:
        a: instance of a Uniform distribution object.
        b: instance of a Uniform distribution object.
        name: (optional) Name to use for created operations.
          default is "kl_uniform_uniform".
  
      Returns:
        Batchwise KL(a || b)
      """
      with tf.name_scope(name or "kl_uniform_uniform"):
          # Consistent with
          # http://www.mast.queensu.ca/~communications/Papers/gil-msc11.pdf, page 60
          # Watch out for the change in conventions--they use 'a' and 'b' to refer to
          # lower and upper bounds respectively there.
          dtype = dtype_util.common_dtype(
              [a.low, a.high, b.low, b.high], tf.float32
          )
          a_low = tf.convert_to_tensor(a.low)
          b_low = tf.convert_to_tensor(b.low)
          a_high = tf.convert_to_tensor(a.high)
          b_high = tf.convert_to_tensor(b.high)
          return tf.where(
              (b_low <= a_low) & (a_high <= b_high),
              tf.math.log(b_high - b_low) - tf.math.log(a_high - a_low),
              dtype_util.as_numpy_dtype(dtype)(np.inf),
          )
  
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import sigmoid
  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 dtype_util
  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
label_desc: Use image node_id 1 for calling a global function with example usage: _kl_uniform_uniform(a, b, name) and returns: tf