| 8 | using namespace test; |
| 9 | |
| 10 | TEST_F(NAIVE, MESH_INDEXING) { |
| 11 | SmallVector<size_t> init_axes; |
| 12 | |
| 13 | auto multi_axis_index_impl = [this, &init_axes](const TensorNDArray& tensors) { |
| 14 | auto opr = handle()->create_operator<IndexingMultiAxisVec>(); |
| 15 | OprProxy<IndexingMultiAxisVec> proxy(init_axes); |
| 16 | proxy.exec(opr.get(), tensors); |
| 17 | }; |
| 18 | |
| 19 | Checker<MeshIndexing> checker(handle()); |
| 20 | checker.set_extra_opr_impl(multi_axis_index_impl); |
| 21 | size_t idx_size0, idx_size1; |
| 22 | IndexRNG rng0{idx_size0, 2}, rng1{idx_size1, 3}; |
| 23 | checker.set_dtype(0, dtype::Float32()) |
| 24 | .set_dtype(1, dtype::Float32()) |
| 25 | .set_dtype(2, dtype::Int32()) |
| 26 | .set_dtype(3, dtype::Int32()) |
| 27 | .set_rng(2, &rng0) |
| 28 | .set_rng(3, &rng1); |
| 29 | |
| 30 | idx_size0 = 23; |
| 31 | init_axes = {0}; |
| 32 | checker.set_proxy({init_axes}) |
| 33 | .execs({{23}, {100}, {100}}) |
| 34 | .execs({{23, 5}, {100, 5}, {100}}); |
| 35 | |
| 36 | idx_size0 = 3; |
| 37 | init_axes = {1}; |
| 38 | checker.set_proxy(init_axes) |
| 39 | .execs({{2, 3}, {2, 10}, {10}}) |
| 40 | .execs({{2, 3, 5}, {2, 50, 5}, {50}}) |
| 41 | .execs({{2, 3, 5, 7}, {2, 55, 5, 7}, {55}}); |
| 42 | } |
| 43 | |
| 44 | TEST_F(NAIVE, BATCHED_MESH_INDEXING) { |
| 45 | SmallVector<size_t> init_axes; |
nothing calls this directly
no test coverage detected