code: def test_mlp_layers(self):
      layers = utils.mlp_layers(
          conv_layer_params=[(3, 4, 5), (4, 6, 8)],
          fc_layer_params=[10, 20],
          activation_fn=tf.keras.activations.tanh,
          name="testnet",
      )
      self.assertEqual(5, len(layers))
  
      self.assertAllEqual(
          [
              tf.keras.layers.Conv2D,
              tf.keras.layers.Conv2D,
              tf.keras.layers.Flatten,
              tf.keras.layers.Dense,
              tf.keras.layers.Dense,
          ],
          [type(layer) for layer in layers],
      )
  
      layers = utils.mlp_layers(
          conv_layer_params=[(3, 4, 5), (4, 6, 8)],
          fc_layer_params=[10, 20],
          activation_fn=tf.keras.activations.tanh,
          dropout_layer_params=[0.5, 0.3],
          name="testnet",
      )
      self.assertEqual(7, len(layers))
  
      self.assertAllEqual(
          [
              tf.keras.layers.Conv2D,
              tf.keras.layers.Conv2D,
              tf.keras.layers.Flatten,
              tf.keras.layers.Dense,
              permanent_variable_rate_dropout.PermanentVariableRateDropout,
              tf.keras.layers.Dense,
              permanent_variable_rate_dropout.PermanentVariableRateDropout,
          ],
          [type(layer) for layer in layers],
      )
  
      layers = utils.mlp_layers(
          conv_layer_params=[(3, 4, 5), (4, 6, 8)],
          fc_layer_params=[10, 20],
          activation_fn=tf.keras.activations.tanh,
          dropout_layer_params=[None, 0.3],
          name="testnet",
      )
      self.assertEqual(6, len(layers))
  
      self.assertAllEqual(
          [
              tf.keras.layers.Conv2D,
              tf.keras.layers.Conv2D,
              tf.keras.layers.Flatten,
              tf.keras.layers.Dense,
              tf.keras.layers.Dense,
              permanent_variable_rate_dropout.PermanentVariableRateDropout,
          ],
          [type(layer) for layer in layers],
      )
  
      layers = utils.mlp_layers(
          conv_layer_params=[(3, 4, 5), (4, 6, 8)],
          fc_layer_params=[10, 20],
          activation_fn=tf.keras.activations.tanh,
          dropout_layer_params=[dict(rate=0.5, permanent=True), None],
          name="testnet",
      )
      self.assertEqual(6, len(layers))
  
      self.assertAllEqual(
          [
              tf.keras.layers.Conv2D,
              tf.keras.layers.Conv2D,
              tf.keras.layers.Flatten,
              tf.keras.layers.Dense,
              permanent_variable_rate_dropout.PermanentVariableRateDropout,
              tf.keras.layers.Dense,
          ],
          [type(layer) for layer in layers],
      )
  
file_path: agents/tf_agents/networks/utils_test.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import tensorflow
  from tf_agents.keras_layers import permanent_variable_rate_dropout
  from tf_agents.networks import utils
label_desc: Use image node_id 7 for calling the NetworkUtilsTest obj's underlying member method code with example usage: obj.test_mlp_layers() without return types