MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / TEST_F

Function TEST_F

dnn/test/naive/mesh_indexing.cpp:10–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8using namespace test;
9
10TEST_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
44TEST_F(NAIVE, BATCHED_MESH_INDEXING) {
45 SmallVector<size_t> init_axes;

Callers

nothing calls this directly

Calls 11

set_dtypeMethod · 0.80
remove_axisMethod · 0.80
add_axis_cont_inplaceMethod · 0.80
emplace_backMethod · 0.80
execMethod · 0.45
getMethod · 0.45
execsMethod · 0.45
sizeMethod · 0.45
raw_ptrMethod · 0.45
broadcastMethod · 0.45
execlMethod · 0.45

Tested by

no test coverage detected