code: def test_type_cupy(self, out_dtype, input_data, expected_type):
      input_data = cp.asarray(input_data)
  
      result = CastToType(dtype=out_dtype)(input_data)
      self.assertTrue(isinstance(result, cp.ndarray))
      self.assertEqual(
          result.dtype,
          get_equivalent_dtype(expected_type, type(result)),
      )
  
      result = CastToType()(input_data, out_dtype)
      self.assertTrue(isinstance(result, cp.ndarray))
      self.assertEqual(
          result.dtype,
          get_equivalent_dtype(expected_type, type(result)),
      )
  
file_path: MONAI/tests/test_cast_to_type.py
imports: from __future__ import annotations
  import unittest
  import numpy
  import torch
  from parameterized import parameterized
  from monai.transforms import CastToType
  from monai.utils import optional_import
  from monai.utils.type_conversion import get_equivalent_dtype
  from tests.utils import HAS_CUPY, TEST_NDARRAYS
label_desc: Use image node_id 2 for calling the TestCastToType obj's underlying member method code with example usage: obj.test_type_cupy(out_dtype, input_data, expected_type) without return types