code: def test_cupy_to_chainerx_contiguous():
      dtype = numpy.float32
      a_cupy = cupy.arange(6, dtype=dtype).reshape((2, 3))
      a_cupy_refcount_before = sys.getrefcount(a_cupy)
  
      a_chx = _fromrawpointer(
          a_cupy.data.mem.ptr,
          a_cupy.shape,
          a_cupy.dtype,
          a_cupy.strides,
          "cuda:0",
          0,
          a_cupy,
      )
  
      assert sys.getrefcount(a_cupy) == a_cupy_refcount_before + 1
      assert a_chx.device.name == "cuda:0"
      chainerx.testing.assert_array_equal_ex(a_chx, a_cupy.get())
  
      # Write to a_cupy
      a_cupy[0, 1] = 8
      chainerx.testing.assert_array_equal_ex(
          a_chx, numpy.array([[0, 8, 2], [3, 4, 5]], dtype)
      )
  
      # Write to a_chx
      a_chx += 1
      chainerx.testing.assert_array_equal_ex(
          a_cupy.get(), numpy.array([[1, 9, 3], [4, 5, 6]], dtype)
      )
  
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 1 for calling a global function with example usage: test_cupy_to_chainerx_contiguous() without return types