code: def test_cupy_to_chainerx_invalid_device():
      dtype = numpy.float32
      with cupy.cuda.Device(1):
          a_cupy = cupy.arange(6, dtype=dtype).reshape((2, 3))
      with pytest.raises(chainerx.ChainerxError):
          _fromrawpointer(
              a_cupy.data.mem.ptr,
              a_cupy.shape,
              a_cupy.dtype,
              a_cupy.strides,
              "cuda:0",
              0,
              a_cupy,
          )
  
file_path: chainer/tests/chainerx_tests/unit_tests/test_cupy_interop.py
imports: import numpy
  import pytest
  import sys
  import chainerx
  import chainerx.testing
label_desc: Use image node_id 8 for calling a global function with example usage: test_cupy_to_chainerx_invalid_device() without return types