code: def _kl_bernoulli_bernoulli(a, b, name=None):
      """Calculate the batched KL divergence KL(a || b) with a and b Bernoulli.
  
      Args:
        a: instance of a Bernoulli distribution object.
        b: instance of a Bernoulli distribution object.
        name: Python `str` name to use for created operations.
          Default value: `None` (i.e., `'kl_bernoulli_bernoulli'`).
  
      Returns:
        Batchwise KL(a || b)
      """
      with tf.name_scope(name or "kl_bernoulli_bernoulli"):
          # KL[a || b] = Pa * Log[Pa / Pb] + (1 - Pa) * Log[(1 - Pa) / (1 - Pb)]
          # This is defined iff (Pb = 0 ==> Pa = 0) AND (Pb = 1 ==> Pa = 1).
          a_logits = (
              a._logits_parameter_no_checks()
          )  # pylint:disable=protected-access
          b_logits = (
              b._logits_parameter_no_checks()
          )  # pylint:disable=protected-access
  
          (
              one_minus_pa,
              pa,
              log_one_minus_pa,
              log_pa,
          ) = _probs_and_log_probs(logits=a_logits)
          log_one_minus_pb, log_pb = _probs_and_log_probs(
              logits=b_logits, return_probs=False
          )
  
          # Multiply each factor individually to avoid Inf - Inf.
          return (
              tf.math.multiply_no_nan(log_pa, pa)
              - tf.math.multiply_no_nan(log_pb, pa)
              + tf.math.multiply_no_nan(log_one_minus_pa, one_minus_pa)
              - tf.math.multiply_no_nan(log_one_minus_pb, one_minus_pa)
          )
  
imports: 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 distribution_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
label_desc: Use image node_id 3 for calling a global function with example usage: _kl_bernoulli_bernoulli(a, b, name) and returns: unknown