code: def test_affine(self, input_param, input_data, expected_val):
      input_copy = deepcopy(input_data["img"])
      g = Affine(**input_param)
      result = g(**input_data)
      output_idx = None
      if isinstance(result, tuple):
          output_idx = 0
          result = result[output_idx]
  
      test_local_inversion(g, result, input_copy)
      assert_allclose(
          result, expected_val, rtol=1e-4, atol=1e-4, type_test=False
      )
  
      set_track_meta(False)
      result = g(**input_data)
      if isinstance(result, tuple):
          result = result[0]
      self.assertNotIsInstance(result, MetaTensor)
      self.assertIsInstance(result, torch.Tensor)
      set_track_meta(True)
  
      # test lazy
      lazy_input_param = input_param.copy()
      for align_corners in [True, False]:
          lazy_input_param["align_corners"] = align_corners
          resampler = Affine(**lazy_input_param)
          non_lazy_result = resampler(**input_data)
          test_resampler_lazy(
              resampler,
              non_lazy_result,
              lazy_input_param,
              input_data,
              output_idx=output_idx,
          )
  
file_path: MONAI/tests/test_affine.py
imports: from __future__ import annotations
  import unittest
  from copy import deepcopy
  import numpy
  import torch
  from parameterized import parameterized
  from monai.data import MetaTensor, set_track_meta
  from monai.transforms import Affine, Resize
  from monai.transforms.lazy.functional import apply_pending
  from monai.utils import optional_import
  from tests.lazy_transforms_utils import test_resampler_lazy
  from tests.utils import TEST_NDARRAYS_ALL, assert_allclose, test_local_inversion
label_desc: Use image node_id 1 for calling the TestAffine obj's underlying member method code with example usage: obj.test_affine(input_param, input_data, expected_val) without return types