code: def _from_cupy(array):
      assert cupy is not None
      assert isinstance(array, cupy.ndarray)
      device = chainerx.get_device("cuda", array.device.id)
      return chainerx._core._fromrawpointer(
          array.data.mem.ptr,
          array.shape,
          array.dtype,
          array.strides,
          device,
          array.data.ptr - array.data.mem.ptr,
          array,
      )
  
file_path: chainer/chainerx/_fallback_workarounds.py
imports: import numpy
  import chainerx
label_desc: Use image node_id 4 for calling a global function with example usage: _from_cupy(array) and returns: chainerx