()
| 1244 | |
| 1245 | |
| 1246 | def 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 | |
| 1279 | class DupPipeline(Pipeline): |
nothing calls this directly
no test coverage detected