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

Function test_arithm_ops_cpu_gpu

dali/test/python/test_dali_cpu_only.py:1187–1212  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1185
1186
1187def test_arithm_ops_cpu_gpu():
1188 pipe = Pipeline(batch_size=batch_size, num_threads=4, device_id=None)
1189 data = fn.external_source(source=get_data, layout="HWC")
1190 processed = [
1191 data * data.gpu(),
1192 data + data.gpu(),
1193 data - data.gpu(),
1194 data / data.gpu(),
1195 data // data.gpu(),
1196 data ** data.gpu(),
1197 data == data.gpu(),
1198 data != data.gpu(),
1199 data < data.gpu(),
1200 data <= data.gpu(),
1201 data > data.gpu(),
1202 data >= data.gpu(),
1203 data & data.gpu(),
1204 data | data.gpu(),
1205 data ^ data.gpu(),
1206 ]
1207 pipe.set_outputs(*processed)
1208 assert_raises(
1209 RuntimeError,
1210 pipe.build,
1211 glob=("The pipeline requires a CUDA-capable GPU but *"),
1212 )
1213
1214
1215@attr("pytorch")

Callers

nothing calls this directly

Calls 4

set_outputsMethod · 0.95
PipelineClass · 0.90
assert_raisesFunction · 0.90
gpuMethod · 0.45

Tested by

no test coverage detected