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

Function test_gpu2cpu2mixed

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

Source from the content-addressed store, hash-verified

2208
2209
2210def test_gpu2cpu2mixed():
2211 bs = 8
2212
2213 @pipeline_def(batch_size=bs, num_threads=4, device_id=0, exec_dynamic=True)
2214 def pdef():
2215 enc, _ = fn.readers.file(file_root=jpeg_folder)
2216 img = fn.decoders.image(enc, device="mixed", hw_decoder_load=0)
2217 enc2 = (enc.gpu() + np.uint8(0)).cpu()
2218 img2 = fn.decoders.image(enc2, device="mixed", hw_decoder_load=0)
2219 return img, img2
2220
2221 pipe = pdef()
2222 for i in range(10):
2223 gpu, gpu2 = pipe.run()
2224 assert isinstance(gpu, dali.backend_impl.TensorListGPU)
2225 assert isinstance(gpu2, dali.backend_impl.TensorListGPU)
2226 check_batch(gpu, gpu2, bs, 0, 0, "HWC")
2227
2228
2229def test_shapes_gpu():

Callers

nothing calls this directly

Calls 3

check_batchFunction · 0.90
pdefFunction · 0.85
runMethod · 0.45

Tested by

no test coverage detected