(iter_type, data_definition)
| 96 | |
| 97 | @nottest |
| 98 | def 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") |
no test coverage detected