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

Function test_api_fw_check2

dali/test/python/test_fw_iterators_detection.py:149–179  ·  view source on GitHub ↗
(iter_type, data_definition)

Source from the content-addressed store, hash-verified

147
148@nottest
149def test_api_fw_check2(iter_type, data_definition):
150 root, annotations = data_paths()
151
152 pipe = DetectionPipeline(BATCH_SIZE, 0, root, annotations)
153 pipe.schedule_run()
154 pipe.share_outputs()
155 pipe.release_outputs()
156 pipe.schedule_run()
157 pipe.outputs()
158 with assert_raises(
159 RuntimeError,
160 glob=(
161 "Mixing pipeline API type. Currently used: PipelineAPIType.SCHEDULED,"
162 " but trying to use PipelineAPIType.ITERATOR"
163 ),
164 ):
165 train_loader = iter_type(
166 [pipe], data_definition, EPOCH_SIZE, auto_reset=False, dynamic_shape=True
167 )
168 train_loader.__next__()
169 # disable check
170 pipe.enable_api_check(False)
171 try:
172 train_loader = iter_type(
173 [pipe], data_definition, EPOCH_SIZE, auto_reset=False, dynamic_shape=True
174 )
175 train_loader.__next__()
176 assert True
177 except RuntimeError:
178 assert False
179 yield check, iter_type
180
181
182def check(iter_type):

Callers 2

Calls 9

assert_raisesFunction · 0.90
enable_api_checkMethod · 0.80
data_pathsFunction · 0.70
DetectionPipelineClass · 0.70
schedule_runMethod · 0.45
share_outputsMethod · 0.45
release_outputsMethod · 0.45
outputsMethod · 0.45
__next__Method · 0.45

Tested by

no test coverage detected