code: def testShape(self, control_name, num_layers):
      batch_size = 5
      input_size = 3
      hidden_size = 7
      control_config = {"hidden_size": hidden_size}
      inputs = tf.random.uniform([batch_size, input_size])
      rnn = control.deep_core(
          num_layers=num_layers,
          control_name=control_name,
          control_config=control_config,
      )
      prev_state = rnn.initial_state(batch_size=batch_size)
      output, next_state = rnn(inputs, prev_state)
  
      # The deep_core concatenates the outputs of the individual cores.
      output_shape = np.ndarray((batch_size, num_layers * hidden_size))
      self.assertShapeEqual(output_shape, output)
  
      tree.map_structure(
          lambda t1, t2: self.assertEqual(t1.shape, t2.shape),
          prev_state,
          next_state,
      )
  
file_path: sonnet/sonnet/src/nets/dnc/control_test.py
imports: from absl.testing import parameterized
  import numpy
  from sonnet.src import recurrent
  from sonnet.src import test_utils
  from sonnet.src.nets.dnc import control
  import tensorflow
  import tree
label_desc: Use image node_id 1 for calling the DeepCore obj's underlying member method code with example usage: obj.testShape(control_name, num_layers) without return types