code: def test_affine(self, input_param, input_data, expected_val):
      input_copy = deepcopy(input_data)
      g = Affined(**input_param)
      result = g(input_data)
      test_local_inversion(g, result, input_copy, dict_key="img")
      assert_allclose(
          result["img"],
          expected_val,
          rtol=1e-4,
          atol=1e-4,
          type_test="tensor",
      )
  
      # test lazy
      lazy_input_param = input_param.copy()
      for align_corners in [True, False]:
          lazy_input_param["align_corners"] = align_corners
          resampler = Affined(**lazy_input_param)
          call_param = {"data": input_data}
          non_lazy_result = resampler(**call_param)
          test_resampler_lazy(
              resampler,
              non_lazy_result,
              lazy_input_param,
              call_param,
              output_key="img",
          )
  
file_path: MONAI/tests/test_affined.py
imports: from __future__ import annotations
  import unittest
  from copy import deepcopy
  import numpy
  import torch
  from parameterized import parameterized
  from monai.transforms import Affined
  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 TestAffined obj's underlying member method code with example usage: obj.test_affine(input_param, input_data, expected_val) without return types