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

Function TEST

src/opr/test/utility.cpp:9–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7using namespace mgb;
8
9TEST(TestOprUtility, AssertEqual) {
10 HostTensorGenerator<> gen;
11 auto host_x = gen({1, 2, 3}), host_y = gen({1, 2, 3});
12 auto graph = ComputingGraph::make();
13 auto x = opr::Host2DeviceCopy::make(*graph, host_x),
14 y = opr::Host2DeviceCopy::make(*graph, host_y),
15 z = opr::AssertEqual::make(x, y);
16 auto func = graph->compile({{z, {}}});
17
18 ASSERT_THROW(func->execute().wait(), MegBrainError);
19 host_y->copy_from(*host_x);
20 ASSERT_NO_THROW(func->execute().wait());
21}
22
23TEST(TestOprUtility, VirtualGradCompNode) {
24 auto cns = load_multiple_xpus(2);

Callers

nothing calls this directly

Calls 15

make_callback_copyFunction · 0.85
is_static_var_valueFunction · 0.85
prev_dev_ptrFunction · 0.85
unpack_vectorFunction · 0.85
is_static_var_storageFunction · 0.85
gradFunction · 0.85
symshapeMethod · 0.80
makeFunction · 0.70
genFunction · 0.50
copyFunction · 0.50
compileMethod · 0.45
waitMethod · 0.45

Tested by

no test coverage detected