class_docstr: Base class for all variational layers.
docstr: Base class for variational layers.
  
  Args:
    posterior: ...
    prior: ...
    activation_fn: ...
    posterior_value_fn: ...
    seed: ...
    dtype: ...
    validate_args: ...
    name: Python `str` prepeneded to ops created by this object.
      Default value: `None` (i.e., `type(self).__name__`).
docstr_tok: ["Base","class","for","variational","layers",".","Args",":","posterior",":","...","prior",":","...","activation_fn",":","...","posterior_value_fn",":","...","seed",":","...","dtype",":","...","validate_args",":","...","name",":","Python","`","str","`","prepeneded","to","ops","created","by","this","object",".","Default","value",":","`","None","`","(","i.e.",",","`","type","(","self",")",".__name__","`",")","."]
code: def __init__(
      self,
      posterior,
      prior,
      activation_fn=None,
      posterior_value_fn=tfd.Distribution.sample,
      seed=None,
      dtype=tf.float32,
      validate_args=False,
      name=None,
  ):
      """Base class for variational layers.
  
      Args:
        posterior: ...
        prior: ...
        activation_fn: ...
        posterior_value_fn: ...
        seed: ...
        dtype: ...
        validate_args: ...
        name: Python `str` prepeneded to ops created by this object.
          Default value: `None` (i.e., `type(self).__name__`).
      """
      super(VariationalLayer, self).__init__(
          validate_args=validate_args, name=name
      )
      self._posterior = posterior
      self._prior = prior
      self._activation_fn = activation_fn
      self._posterior_value_fn = posterior_value_fn
      self._posterior_value = None
      self._seed = SeedStream(seed, salt=self.name)
      self._dtype = dtype
      tf.nest.assert_same_structure(
          prior.dtype, posterior.dtype, check_types=False
      )
  
imports: import collections
  import tensorflow.compat.v2
  from tensorflow_probability.python import random
  from tensorflow_probability.python.distributions import distribution
  from tensorflow_probability.python.distributions import independent
  from tensorflow_probability.python.distributions import mvn_diag
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.experimental.nn import layers
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.util.seed_stream import SeedStream
label_desc: Use image node_id 1 to create a new VariationalLayer object from inherited base classes: layers_lib with example: obj = VariationalLayer(posterior, prior, activation_fn, posterior_value_fn, seed, dtype, validate_args, name)