code: def _testKerasLayer(self, layer_class):
      def kernel_posterior_fn(
          dtype, shape, name, trainable, add_variable_fn
      ):
          """Set trivially. The function is required to instantiate layer."""
          del name, trainable, add_variable_fn  # unused
          # Deserialized Keras objects do not perform lexical scoping. Any modules
          # that the function requires must be imported within the function.
          import tensorflow.compat.v2 as tf  # pylint: disable=g-import-not-at-top,redefined-outer-name,reimported
          from tensorflow_probability.python.distributions import (
              independent,
          )  # pylint: disable=g-import-not-at-top,redefined-outer-name,reimported
          from tensorflow_probability.python.distributions import (
              normal,
          )  # pylint: disable=g-import-not-at-top,redefined-outer-name,reimported
  
          dist = normal.Normal(
              loc=tf.zeros(shape, dtype), scale=tf.ones(shape, dtype)
          )
          batch_ndims = tf.size(dist.batch_shape_tensor())
          return independent.Independent(
              dist, reinterpreted_batch_ndims=batch_ndims
          )
  
      kwargs = {
          "units": 3,
          "kernel_posterior_fn": kernel_posterior_fn,
          "kernel_prior_fn": None,
          "bias_posterior_fn": None,
          "bias_prior_fn": None,
      }
      with tf_keras.utils.CustomObjectScope(
          {layer_class.__name__: layer_class}
      ):
          # TODO(scottzhu): reenable the test when the repo switch change reach
          # the TF PIP package.
          self.skipTest(
              "Skip the test until the TF and Keras has a new PIP."
          )
          with self.cached_session():
              keras_test_utils.layer_test(
                  layer_class, kwargs=kwargs, input_shape=(3, 2)
              )
              keras_test_utils.layer_test(
                  layer_class,
                  kwargs=kwargs,
                  input_shape=(None, None, 2),
              )
  
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import independent
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.internal import tf_keras
  from tensorflow_probability.python.layers import dense_variational
  from tensorflow_probability.python.layers import util
  from tensorflow_probability.python.random import random_ops
  from tensorflow_probability.python.util import seed_stream
label_desc: Use image node_id 1 for calling the DenseVariational obj's underlying member method code with example usage: obj._testKerasLayer(layer_class) and returns: independent