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.
docstr: Creates a layer from its config.
  
  This method is the reverse of `get_config`, capable of instantiating the
  same layer from the config dictionary.
  
  Args:
    config: A Python dictionary, typically the output of `get_config`.
  
  Returns:
    layer: A layer instance.
docstr_tok: ["Creates","a","layer","from","its","config",".","This","method","is","the","reverse","of","`","get_config","`",",","capable","of","instantiating","the","same","layer","from","the","config","dictionary",".","Args",":","config",":","A","Python","dictionary",",","typically","the","output","of","`","get_config","`",".","Returns",":","layer",":","A","layer","instance","."]
code: def from_config(cls, config):
      """Creates a layer from its config.
  
      This method is the reverse of `get_config`, capable of instantiating the
      same layer from the config dictionary.
  
      Args:
        config: A Python dictionary, typically the output of `get_config`.
  
      Returns:
        layer: A layer instance.
      """
      config = config.copy()
      function_keys = [
          "kernel_posterior_fn",
          "kernel_posterior_tensor_fn",
          "kernel_prior_fn",
          "kernel_divergence_fn",
          "bias_posterior_fn",
          "bias_posterior_tensor_fn",
          "bias_prior_fn",
          "bias_divergence_fn",
      ]
      for function_key in function_keys:
          serial = config[function_key]
          function_type = config.pop(function_key + "_type")
          if serial is not None:
              config[
                  function_key
              ] = tfp_layers_util.deserialize_function(
                  serial, function_type=function_type
              )
      return cls(**config)
  
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 6 for calling the _DenseVariational obj's underlying member method code with example usage: obj.from_config(cls, config) and returns: cls