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

Function test_api_fw_check1

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

Source from the content-addressed store, hash-verified

96
97@nottest
98def test_api_fw_check1(iter_type, data_definition):
99 root, annotations = data_paths()
100 pipe = DetectionPipeline(BATCH_SIZE, 0, root, annotations)
101 train_loader = iter_type(
102 [pipe], data_definition, EPOCH_SIZE, auto_reset=False, dynamic_shape=True
103 )
104 train_loader.__next__()
105 for method in [
106 pipe.schedule_run,
107 pipe.share_outputs,
108 pipe.release_outputs,
109 pipe.outputs,
110 pipe.run,
111 ]:
112 with assert_raises(
113 RuntimeError,
114 glob="Mixing pipeline API type. Currently used: PipelineAPIType.ITERATOR,"
115 " but trying to use PipelineAPIType.*",
116 ):
117 method()
118 # disable check
119 pipe.enable_api_check(False)
120 for method in [
121 pipe.schedule_run,
122 pipe.share_outputs,
123 pipe.release_outputs,
124 pipe.outputs,
125 pipe.run,
126 ]:
127 try:
128 method()
129 except RuntimeError:
130 assert False
131 yield check, iter_type
132
133
134@attr("pytorch")

Callers 2

Calls 5

assert_raisesFunction · 0.90
enable_api_checkMethod · 0.80
data_pathsFunction · 0.70
DetectionPipelineClass · 0.70
__next__Method · 0.45

Tested by

no test coverage detected