(use_fn_api, device)
| 296 | |
| 297 | |
| 298 | def _test_external_source_iter(use_fn_api, device): |
| 299 | iter_num = 5 |
| 300 | batch_size = 9 |
| 301 | pipe = Pipeline(batch_size, 3, 0) |
| 302 | |
| 303 | # this should produce a single Tensor / TensorList per batch, |
| 304 | # not wrapped in additional list |
| 305 | source = TestIterator(iter_num, batch_size, 4, device == "gpu") |
| 306 | |
| 307 | if use_fn_api: |
| 308 | input = fn.external_source(source, device=device) |
| 309 | else: |
| 310 | ext_source = ops.ExternalSource(source, device=device) |
| 311 | input = ext_source() |
| 312 | pipe.set_outputs(input) |
| 313 | |
| 314 | run_and_check(pipe, source) |
| 315 | |
| 316 | |
| 317 | def test_external_source_iter(): |
nothing calls this directly
no test coverage detected