code: def test_orntd_torch(
      self, init_param, img: torch.Tensor, track_meta: bool, device
  ):
      set_track_meta(track_meta)
      ornt = Orientationd(**init_param)
      img = img.to(device)
      expected_shape = img.shape
      expected_code = ornt.ornt_transform.axcodes
      call_param = {"data": {k: img.clone() for k in ornt.keys}}
      res = ornt(**call_param)  # type: ignore[arg-type]
      for k in ornt.keys:
          _im = res[k]
          np.testing.assert_allclose(_im.shape, expected_shape)
          if track_meta:
              if img.ndim in (3, 4):
                  test_resampler_lazy(
                      ornt, res, init_param, call_param, output_key=k
                  )
              self.assertIsInstance(_im, MetaTensor)
              assert isinstance(
                  _im, MetaTensor
              )  # for mypy type narrowing
              code = nib.aff2axcodes(
                  _im.affine.cpu(), ornt.ornt_transform.labels
              )
              self.assertEqual("".join(code), expected_code)
          else:
              self.assertIsInstance(_im, torch.Tensor)
              self.assertNotIsInstance(_im, MetaTensor)
  
file_path: MONAI/tests/test_orientationd.py
imports: from __future__ import annotations
  import unittest
  import nibabel
  import numpy
  import torch
  from parameterized import parameterized
  from monai.data.meta_obj import set_track_meta
  from monai.data.meta_tensor import MetaTensor
  from monai.transforms import Orientationd
  from tests.lazy_transforms_utils import test_resampler_lazy
  from tests.utils import TEST_DEVICES
label_desc: Use image node_id 2 for calling the TestOrientationdCase obj's underlying member method code with example usage: obj.test_orntd_torch(init_param, img, track_meta, device) without return types