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

Function test_gpu2cpu

dali/test/python/test_pipeline.py:2181–2195  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2179
2180
2181def test_gpu2cpu():
2182 bs = 8
2183
2184 @pipeline_def(batch_size=bs, num_threads=4, device_id=0, exec_dynamic=True)
2185 def pdef():
2186 enc, _ = fn.readers.file(file_root=jpeg_folder)
2187 img = fn.decoders.image(enc, device="mixed")
2188 return img, img.cpu()
2189
2190 pipe = pdef()
2191 for i in range(10):
2192 gpu, cpu = pipe.run()
2193 assert isinstance(gpu, dali.backend_impl.TensorListGPU)
2194 assert isinstance(cpu, dali.backend_impl.TensorListCPU)
2195 check_batch(cpu, gpu, bs, 0, 0, "HWC")
2196
2197
2198def test_gpu2cpu_arg_input():

Callers

nothing calls this directly

Calls 3

check_batchFunction · 0.90
pdefFunction · 0.85
runMethod · 0.45

Tested by

no test coverage detected