code: def test_shape(self, input_param, theta, expected_val):
      layer = AffineHead(**input_param)
      if input_param.get("save_theta"):
          assert_allclose(layer.theta, torch.Tensor())
      result = layer.affine_transform(theta)
      np.testing.assert_allclose(
          result.cpu().numpy(),
          expected_val.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 TestAffineHead obj's underlying member method code with example usage: obj.test_shape(input_param, theta, expected_val) without return types