code: def testAddConvLayers(self):
      batch_size = 3
      num_state_dims = 5
      action_spec = tensor_spec.BoundedTensorSpec([1], tf.int32, 0, 1)
      num_actions = action_spec.maximum - action_spec.minimum + 1
      self.assertEqual(num_actions, 2)
  
      observations_spec = tensor_spec.TensorSpec(
          [3, 3, num_state_dims], tf.float32
      )
      observations = tf.random.uniform(
          [batch_size, 3, 3, num_state_dims]
      )
      time_steps = ts.restart(observations, batch_size)
  
      q_network = categorical_q_network.CategoricalQNetwork(
          input_tensor_spec=observations_spec,
          action_spec=action_spec,
          conv_layer_params=[(16, 2, 1), (15, 2, 1)],
      )
  
      logits, _ = q_network(time_steps.observation)
      self.assertAllEqual(
          logits.shape.as_list(),
          [batch_size, num_actions, q_network._num_atoms],
      )
  
      # This time there are two conv layers and one final logits layer, for a
      # total of 6 trainable_variables.
      self.assertLen(q_network.trainable_variables, 6)
  
file_path: agents/tf_agents/networks/categorical_q_network_test.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import gin
  import tensorflow
  from tf_agents.networks import categorical_q_network
  from tf_agents.specs import tensor_spec
  from tf_agents.trajectories import time_step
  from tf_agents.utils import test_utils
label_desc: Use image node_id 4 for calling the CategoricalQNetworkTest obj's underlying member method code with example usage: obj.testAddConvLayers() without return types