code: def test_to_norm_affine(
      self,
      affine,
      src_size,
      dst_size,
      align_corners,
      expected,
      zero_centered=False,
  ):
      affine = torch.as_tensor(
          affine, device=torch.device("cpu:0"), dtype=torch.float32
      )
      new_affine = to_norm_affine(
          affine, src_size, dst_size, align_corners, zero_centered
      )
      new_affine = new_affine.detach().cpu().numpy()
      np.testing.assert_allclose(new_affine, expected, atol=1e-6)
  
      if torch.cuda.is_available():
          affine = torch.as_tensor(
              affine, device=torch.device("cuda:0"), dtype=torch.float32
          )
          new_affine = to_norm_affine(
              affine, src_size, dst_size, align_corners, zero_centered
          )
          new_affine = new_affine.detach().cpu().numpy()
          np.testing.assert_allclose(
              new_affine, expected, atol=1e-5, rtol=_rtol
          )
  
imports: from __future__ import annotations
  import unittest
  import numpy
  import torch
  from parameterized import parameterized
  from monai.networks import normalize_transform, to_norm_affine
  from monai.networks.layers import AffineTransform
  from tests.utils import is_tf32_env
label_desc: Use image node_id 1 for calling the TestToNormAffine obj's underlying member method code with example usage: obj.test_to_norm_affine(affine, src_size, dst_size, align_corners, expected, zero_centered) without return types