code: def test_transpose(self, im, indices):
      data = {"i": deepcopy(im), "j": deepcopy(im)}
      tr = Transposed(["i", "j"], indices)
      out_data = tr(data)
      out_im1, out_im2 = out_data["i"], out_data["j"]
      if isinstance(im, torch.Tensor):
          im = im.cpu().numpy()
      out_gt = np.transpose(im, indices)
      assert_allclose(out_im1, out_gt, type_test=False)
      assert_allclose(out_im2, out_gt, type_test=False)
  
      # test inverse
      fwd_inv_data = tr.inverse(out_data)
      for i, j in zip(data.values(), fwd_inv_data.values()):
          assert_allclose(i, j, type_test=False)
  
file_path: MONAI/tests/test_transposed.py
imports: from __future__ import annotations
  import unittest
  from copy import deepcopy
  import numpy
  import torch
  from parameterized import parameterized
  from monai.transforms import Transposed
  from tests.utils import TEST_NDARRAYS, assert_allclose
label_desc: Use image node_id 1 for calling the TestTranspose obj's underlying member method code with example usage: obj.test_transpose(im, indices) without return types