class_docstr: Abstract densely-connected class (private, used as implementation base).
  
  This layer implements the Bayesian variational inference analogue to
  a dense layer by assuming the `kernel` and/or the `bias` are drawn
  from distributions. By default, the layer implements a stochastic
  forward pass via sampling from the kernel and bias posteriors,
  
  ```none
  kernel, bias ~ posterior
  outputs = activation(matmul(inputs, kernel) + bias)
  ```
  
  The arguments permit separate specification of the surrogate posterior
  (`q(W|x)`), prior (`p(W)`), and divergence for both the `kernel` and `bias`
  distributions.
code: def _apply_divergence(
      self, divergence_fn, posterior, prior, posterior_tensor, name
  ):
      if divergence_fn is None or posterior is None or prior is None:
          divergence = None
          return
      divergence = tf.identity(
          divergence_fn(posterior, prior, posterior_tensor), name=name
      )
      self.add_loss(divergence)
  
imports: import tensorflow.compat.v2
  from tensorflow_probability.python import random
  from tensorflow_probability.python.distributions import independent
  from tensorflow_probability.python.distributions import kullback_leibler
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.internal import docstring_util
  from tensorflow_probability.python.internal import tf_keras
  from tensorflow_probability.python.layers import util
  from tensorflow_probability.python.util import SeedStream
label_desc: Use image node_id 8 for calling the _DenseVariational obj's underlying member method code with example usage: obj._apply_divergence(divergence_fn, posterior, prior, posterior_tensor, name) without return types