code: def test_ornt_torch(
      self, init_param, img: torch.Tensor, track_meta: bool, device
  ):
      set_track_meta(track_meta)
      ornt = Orientation(**init_param)
  
      img = img.to(device)
      expected_data = img.clone()
      expected_code = ornt.axcodes
  
      res = ornt(img)
      assert_allclose(res, expected_data)
      if track_meta:
          self.assertIsInstance(res, MetaTensor)
          assert isinstance(res, MetaTensor)  # for mypy type narrowing
          new_code = nib.orientations.aff2axcodes(
              res.affine.cpu(), labels=ornt.labels
          )
          self.assertEqual("".join(new_code), expected_code)
      else:
          self.assertIsInstance(res, torch.Tensor)
          self.assertNotIsInstance(res, MetaTensor)
  
file_path: MONAI/tests/test_orientation.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 Orientation, create_rotate, create_translate
  from tests.lazy_transforms_utils import test_resampler_lazy
  from tests.utils import TEST_DEVICES, assert_allclose
label_desc: Use image node_id 2 for calling the TestOrientationCase obj's underlying member method code with example usage: obj.test_ornt_torch(init_param, img, track_meta, device) without return types