code: def _test_nd_output_shape(self, rank, param_dict, expected_shape):
      if rank == 2:
          input_data = self.get_2d_input()
      elif rank == 3:
          input_data = self.get_3d_input()
  
      res_layer = Res(**param_dict)
      output_data = res_layer(input_data)
      print(res_layer)
      with self.cached_session() as sess:
          sess.run(tf.global_variables_initializer())
          out = sess.run(output_data)
          self.assertAllClose(expected_shape, out.shape)
  
file_path: NiftyNet/tests/residual_unit_test.py
imports: from __future__ import absolute_import, print_function
  import tensorflow
  from niftynet.layer.residual_unit import ResidualUnit
  from niftynet.layer.residual_unit import SUPPORTED_OP
  from tests.niftynet_testcase import NiftyNetTestCase
label_desc: Use image node_id 3 for calling the ResidualUnitTest obj's underlying member method code with example usage: obj._test_nd_output_shape(rank, param_dict, expected_shape) without return types