class_docstr: Dense layer with random `kernel` and `bias`.
  
  This layer uses variational inference to fit a "surrogate" posterior to the
  distribution over both the `kernel` matrix and the `bias` terms which are
  otherwise used in a manner similar to `tf_keras.layers.Dense`.
  
  This layer fits the "weights posterior" according to the following generative
  process:
  
  ```none
  [K, b] ~ Prior()
  M = matmul(X, K) + b
  Y ~ Likelihood(M)
  ```
code: def build(self, input_shape):
      dtype = tf.as_dtype(self.dtype or tf_keras.backend.floatx())
      if not (dtype.is_floating or dtype.is_complex):
          raise TypeError(
              "Unable to build `Dense` layer with non-floating point "
              "dtype %s" % (dtype,)
          )
      input_shape = tf.TensorShape(input_shape)
      last_dim = tf.compat.dimension_value(input_shape[-1])
      if last_dim is None:
          raise ValueError(
              "The last dimension of the inputs to `DenseVariational` "
              "should be defined. Found `None`."
          )
      self.input_spec = tf_keras.layers.InputSpec(
          min_ndim=2, axes={-1: last_dim}
      )
  
      with tf.name_scope("posterior"):
          self._posterior = self._make_posterior_fn(
              last_dim * self.units,
              self.units if self.use_bias else 0,
              dtype,
          )
      with tf.name_scope("prior"):
          self._prior = self._make_prior_fn(
              last_dim * self.units,
              self.units if self.use_bias else 0,
              dtype,
          )
  
      self.built = True
  
file_path: probability/tensorflow_probability/python/layers/dense_variational_v2.py
imports: import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import kullback_leibler
  from tensorflow_probability.python.internal import tf_keras
label_desc: Use image node_id 2 for calling the DenseVariational obj's underlying member method code with example usage: obj.build(input_shape) without return types