code: def test_assert(func, params, expected):
      gpu_test = ("torch_gpu",) if torch.cuda.is_available() else ()
      for b in ("torch", "numpy") + gpu_test:
          if b == "torch_gpu":
              m = func(*params, device="cuda:0", backend="torch")
          else:
              m = func(*params, backend=b)
          assert_allclose(
              m,
              expected,
              type_test=False,
              rtol=1e-2 if is_tf32_env() else 1e-5,
              atol=1e-5,
          )
  
file_path: MONAI/tests/test_create_grid_and_affine.py
imports: from __future__ import annotations
  import unittest
  import numpy
  import torch
  from monai.transforms import create_control_grid, create_grid, create_rotate, create_scale, create_shear, create_translate
  from tests.utils import assert_allclose, is_tf32_env
label_desc: Use image node_id 1 for calling a global function with example usage: test_assert(func, params, expected) without return types