code: def test_shape(self, input_param, input_shape, expected_shape):
      net = GlobalNet(**input_param).to(device)
      warp_layer = Warp()
      with eval_mode(net):
          img = torch.randn(input_shape)
          result = net(img.to(device))
          if input_param.get("save_theta"):
              assert_allclose(
                  net.output_block.theta,
                  torch.Tensor([[1.0, 0.0, 0.0, 0.0, 1.0, 0.0]]),
              )
          warped = warp_layer(img.to(device), result)
          self.assertEqual(result.shape, expected_shape)
          # testing initial pred identity
          np.testing.assert_allclose(
              warped.detach().cpu().numpy(),
              img.detach().cpu().numpy(),
              rtol=1e-4,
              atol=1e-4,
          )
  
file_path: MONAI/tests/test_globalnet.py
imports: from __future__ import annotations
  import unittest
  import numpy
  import torch
  from parameterized import parameterized
  from monai.networks import eval_mode
  from monai.networks.blocks import Warp
  from monai.networks.nets import GlobalNet
  from monai.networks.nets.regunet import AffineHead
  from tests.utils import assert_allclose, test_script_save
label_desc: Use image node_id 1 for calling the TestGlobalNet obj's underlying member method code with example usage: obj.test_shape(input_param, input_shape, expected_shape) without return types