code: def testModelForwardsFunction(self, batch_size):
      image_batch = tf.constant(
          np.random.randn(batch_size, 24, 24, 3), dtype=tf.float32
      )
  
      convnet = cifar10_convnet.Cifar10ConvNet()
      convnet_function = tf.function(convnet)
      output = convnet_function(image_batch, is_training=True)
      self.assertLen(convnet.variables, 112)
      self.assertEqual(output["logits"].shape, [batch_size, 10])
      # One intermediate activation per conv layer, plus one after the global
      # mean pooling, before the linear.
      self.assertLen(output["activations"], 12)
  
file_path: sonnet/sonnet/src/nets/cifar10_convnet_test.py
imports: from absl.testing import parameterized
  import numpy
  from sonnet.src import test_utils
  from sonnet.src.nets import cifar10_convnet
  import tensorflow
label_desc: Use image node_id 4 for calling the ModelTest obj's underlying member method code with example usage: obj.testModelForwardsFunction(batch_size) without return types