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

Function check_bad_device

dali/test/python/test_dali_cpu_only.py:116–126  ·  view source on GitHub ↗
(device_id, error_msg)

Source from the content-addressed store, hash-verified

114
115
116def check_bad_device(device_id, error_msg):
117 test_data_shape = [1, 3, 0, 4]
118
119 def get_data():
120 out = [np.empty(test_data_shape, dtype=np.uint8) for _ in range(batch_size)]
121 return out
122
123 pipe = Pipeline(batch_size=batch_size, num_threads=3, device_id=device_id)
124 outs = fn.external_source(source=get_data, device="gpu")
125 pipe.set_outputs(outs)
126 assert_raises(RuntimeError, pipe.build, glob=error_msg)
127
128
129def test_gpu_op_bad_device():

Callers

nothing calls this directly

Calls 3

set_outputsMethod · 0.95
PipelineClass · 0.90
assert_raisesFunction · 0.90

Tested by

no test coverage detected