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

Function test_api_check2

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

Source from the content-addressed store, hash-verified

1244
1245
1246def test_api_check2():
1247 batch_size = 1
1248
1249 class TestPipeline(Pipeline):
1250 def __init__(self, batch_size, num_threads, device_id, num_gpus):
1251 super(TestPipeline, self).__init__(batch_size, num_threads, device_id)
1252 self.input = ops.readers.Caffe(
1253 path=caffe_db_folder, shard_id=device_id, num_shards=num_gpus
1254 )
1255
1256 def define_graph(self):
1257 inputs, labels = self.input(name="Reader")
1258 return inputs
1259
1260 pipe = TestPipeline(batch_size=batch_size, num_threads=1, device_id=0, num_gpus=1)
1261 pipe.schedule_run()
1262 pipe.share_outputs()
1263 pipe.release_outputs()
1264 pipe.schedule_run()
1265 pipe.outputs()
1266 with assert_raises(
1267 RuntimeError,
1268 glob=(
1269 "Mixing pipeline API type. Currently used: PipelineAPIType.SCHEDULED,"
1270 " but trying to use PipelineAPIType.BASIC"
1271 ),
1272 ):
1273 pipe.run()
1274 # disable check
1275 pipe.enable_api_check(False)
1276 pipe.run()
1277
1278
1279class DupPipeline(Pipeline):

Callers

nothing calls this directly

Calls 8

assert_raisesFunction · 0.90
enable_api_checkMethod · 0.80
TestPipelineClass · 0.70
schedule_runMethod · 0.45
share_outputsMethod · 0.45
release_outputsMethod · 0.45
outputsMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected