()
| 31 | |
| 32 | |
| 33 | def test_plain_indexing(): |
| 34 | data = [np.float32([[0, 1, 2], [3, 4, 5]]), np.float32([[0, 1], [2, 3], [4, 5]])] |
| 35 | src = fn.external_source(lambda: data, layout="AB") |
| 36 | pipe = index_pipe(src, lambda x: x[1, 1]) |
| 37 | inp, cpu, gpu = tuple(out.as_cpu() for out in pipe.run()) |
| 38 | for i in range(len(inp)): |
| 39 | x = inp.at(i) |
| 40 | assert np.array_equal(x[1, 1], cpu.at(i)) |
| 41 | assert np.array_equal(x[1, 1], gpu.at(i)) |
| 42 | |
| 43 | |
| 44 | def _test_indexing(data_gen, input_layout, output_layout, dali_index_func, ref_index_func=None): |
nothing calls this directly
no test coverage detected