class_docstr: Densely-connected layer class with Flipout estimator.
  
  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)
  ```
  
  It uses the Flipout estimator [(Wen et al., 2018)][1], which performs a Monte
  Carlo approximation of the distribution integrating over the `kernel` and
  `bias`. Flipout uses roughly twice as many floating point operations as the
  reparameterization estimator but has the advantage of significantly lower
  variance.
  
  The arguments permit separate specification of the surrogate posterior
  (`q(W|x)`), prior (`p(W)`), and divergence for both the `kernel` and `bias`
  distributions.
  
  Upon being built, this layer adds losses (accessible via the `losses`
  property) representing the divergences of `kernel` and/or `bias` surrogate
  posteriors and their respective priors. When doing minibatch stochastic
  optimization, make sure to scale this loss such that it is applied just once
  per epoch (e.g. if `kl` is the sum of `losses` for each element of the batch,
  you should pass `kl / num_examples_per_epoch` to your optimizer).
  
  #### Examples
  
  We illustrate a Bayesian neural network with [variational inference](
  https://en.wikipedia.org/wiki/Variational_Bayesian_methods),
  assuming a dataset of `features` and `labels`.
  
  ```python
  import tensorflow_probability as tfp
  
  model = tf_keras.Sequential([
      tfp.layers.DenseFlipout(512, activation=tf.nn.relu),
      tfp.layers.DenseFlipout(10),
  ])
  
  logits = model(features)
  neg_log_likelihood = tf.nn.softmax_cross_entropy_with_logits(
      labels=labels, logits=logits)
  kl = sum(model.losses)
  loss = neg_log_likelihood + kl
  train_op = tf.train.AdamOptimizer().minimize(loss)
  ```
  
  It uses the Flipout gradient estimator to minimize the
  Kullback-Leibler divergence up to a constant, also known as the
  negative Evidence Lower Bound. It consists of the sum of two terms:
  the expected negative log-likelihood, which we approximate via
  Monte Carlo; and the KL divergence, which is added via regularizer
  terms which are arguments to the layer.
  
  #### References
  
  [1]: Yeming Wen, Paul Vicol, Jimmy Ba, Dustin Tran, and Roger Grosse. Flipout:
       Efficient Pseudo-Independent Weight Perturbations on Mini-Batches. In
       _International Conference on Learning Representations_, 2018.
       https://arxiv.org/abs/1803.04386
docstr: Returns the config of the layer.
  
  A layer config is a Python dictionary (serializable) containing the
  configuration of a layer. The same layer can be reinstantiated later
  (without its trained weights) from this configuration.
  
  Returns:
    config: A Python dictionary of class keyword arguments and their
      serialized values.
docstr_tok: ["Returns","the","config","of","the","layer",".","A","layer","config","is","a","Python","dictionary","(","serializable",")","containing","the","configuration","of","a","layer",".","The","same","layer","can","be","reinstantiated","later","(","without","its","trained","weights",")","from","this","configuration",".","Returns",":","config",":","A","Python","dictionary","of","class","keyword","arguments","and","their","serialized","values","."]
code: def get_config(self):
      """Returns the config of the layer.
  
      A layer config is a Python dictionary (serializable) containing the
      configuration of a layer. The same layer can be reinstantiated later
      (without its trained weights) from this configuration.
  
      Returns:
        config: A Python dictionary of class keyword arguments and their
          serialized values.
      """
      config = {
          "seed": self.seed,
      }
      base_config = super(DenseFlipout, self).get_config()
      return dict(list(base_config.items()) + list(config.items()))
  
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 3 for calling the DenseFlipout obj's underlying member method code with example usage: obj.get_config() and returns: dict