code: def test_tensor_gpu_from_cupy():
      def create_tmp(idx):
          a = np.full((4, 4), idx)
          a_gpu = cp.array(a, dtype=a.dtype)
          return tensors.TensorGPU(a_gpu, "")
  
      out = [create_tmp(i) for i in range(4)]
      for i, t in enumerate(out):
          np.testing.assert_array_equal(
              np.array(t.as_cpu()), np.full((4, 4), i)
          )
  
imports: from nvidia.dali.backend_impl import TensorGPU, TensorListGPU
  from nvidia.dali.pipeline import Pipeline
  import nvidia.dali.ops
  import nvidia.dali.tensors
  import nvidia.dali.types
  import numpy
  from nose_utils import assert_raises, raises
  import cupy
  from test_utils import py_buffer_from_address
label_desc: Use image node_id 31 for calling a global function with example usage: test_tensor_gpu_from_cupy() and returns: tensors