code: def test_transform(self):
      mod = snt.Linear(1, w_init=tf.ones)
      snt.allow_empty_variables(mod)
      self.assertEmpty(mod.variables)
  
      f = hk.transform(mod)
      x = tf.ones([1, 1])
  
      params = f.init(x)
      self.assertLen(params.items(), 2)
      self.assertAllEqual(params[mod.w.ref()], [[1.0]])
      self.assertAllEqual(params[mod.b.ref()], [0.0])
  
      y = f.apply(params, x)
      self.assertEqual(y, [[1.0]])
  
      params = tree.map_structure(lambda p: p + 1, params)
      y = f.apply(params, x)
      self.assertEqual(y, [[3.0]])
  
imports: from absl.testing import parameterized
  import sonnet
  from sonnet.src import test_utils
  from sonnet.src.functional import haiku
  import tensorflow
  import tree
label_desc: Use image node_id 1 for calling the NetworkTest obj's underlying member method code with example usage: obj.test_transform() without return types