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

Function TEST

dnn/test/dispatcher/warp_perspective.cpp:11–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9
10#if !MEGDNN_NO_THREAD
11TEST(DISPATCHER, WARP_PERSPECTIVE) {
12 std::shared_ptr<MegcoreCPUDispatcher> dispatcher =
13 std::make_shared<NullDispatcher>();
14 auto handle = create_cpu_handle_with_dispatcher(0, dispatcher);
15
16 auto opr = handle->create_operator<WarpPerspective>();
17 auto src_layout = TensorLayout({2, 3, 10, 10}, dtype::Float32()),
18 mat_layout = TensorLayout({2, 3, 3}, dtype::Float32()),
19 dst_layout = TensorLayout({2, 3, 10, 10}, dtype::Float32());
20 TensorND src(nullptr, src_layout), mat(nullptr, mat_layout),
21 dst(nullptr, dst_layout);
22 opr->param().imode = param::WarpPerspective::InterpolationMode::LINEAR;
23 auto wsize = opr->get_workspace_in_bytes(src_layout, mat_layout, dst_layout);
24 Workspace workspace(nullptr, wsize);
25
26 opr->exec(src, mat, dst, workspace);
27}
28#endif
29
30} // namespace test

Callers

nothing calls this directly

Calls 4

TensorLayoutClass · 0.85
paramMethod · 0.45
execMethod · 0.45

Tested by

no test coverage detected