MCPcopy Create free account
hub / github.com/NVIDIA/DALI / test_tensor_gpu_from_cupy

Function test_tensor_gpu_from_cupy

dali/test/python/test_backend_impl_gpu.py:345–353  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

343
344
345def test_tensor_gpu_from_cupy():
346 def create_tmp(idx):
347 a = np.full((4, 4), idx)
348 a_gpu = cp.array(a, dtype=a.dtype)
349 return tensors.TensorGPU(a_gpu, "")
350
351 out = [create_tmp(i) for i in range(4)]
352 for i, t in enumerate(out):
353 np.testing.assert_array_equal(np.array(t.as_cpu()), np.full((4, 4), i))
354
355
356def test_tensor_list_gpu_from_cupy():

Callers

nothing calls this directly

Calls 1

create_tmpFunction · 0.70

Tested by

no test coverage detected