code: def test_rand_affine(self, input_param, input_data, expected_val):
      g = RandAffine(**input_param)
      g.set_random_state(123)
      result = g(**input_data)
      g.rand_affine_grid.affine = torch.eye(
          4, dtype=torch.float64
      )  # reset affine
      test_resampler_lazy(g, result, input_param, input_data, seed=123)
      if input_param.get("cache_grid", False):
          self.assertTrue(g._cached_grid is not None)
      assert_allclose(
          result,
          expected_val,
          rtol=_rtol,
          atol=1e-4,
          type_test="tensor",
      )
  
file_path: MONAI/tests/test_rand_affine.py
imports: from __future__ import annotations
  import unittest
  import numpy
  import torch
  from parameterized import parameterized
  from monai.transforms import RandAffine
  from monai.utils.type_conversion import convert_data_type
  from tests.lazy_transforms_utils import test_resampler_lazy
  from tests.utils import TEST_NDARRAYS_ALL, assert_allclose, is_tf32_env
label_desc: Use image node_id 1 for calling the TestRandAffine obj's underlying member method code with example usage: obj.test_rand_affine(input_param, input_data, expected_val) without return types