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

Function TEST

src/core/test/graph/add_update.cpp:11–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9
10#if MGB_ENABLE_EXCEPTION
11TEST(TestGraph, ForceUpdate0) {
12 // opr taking both versions of var
13 auto t0 =
14 std::make_shared<DeviceTensorND>(CompNode::load("xpu0"), TensorShape{2, 2});
15 auto t1 = std::make_shared<HostTensorND>(CompNode::load("xpu0"), TensorShape{2, 2});
16 auto graph = ComputingGraph::make();
17 SymbolVar x = opr::SharedDeviceTensor::make(*graph, t0),
18 y = opr::Host2DeviceCopy::make(*graph, t1),
19 z = opr::AddUpdate::make(x, y), zz = opr::add(x, z);
20 EXPECT_THROW(graph->compile({{zz, [](DeviceTensorND&) {}}}), GraphError);
21}
22#endif
23
24TEST(TestGraph, ForceUpdate1) {

Callers

nothing calls this directly

Calls 15

addFunction · 0.85
set_priorityFunction · 0.85
make_callback_copyFunction · 0.85
dev_ptrFunction · 0.85
unpack_vectorFunction · 0.85
renameMethod · 0.80
input_waiting_specMethod · 0.80
prev_dev_ptrMethod · 0.80
set_readyMethod · 0.80
device_wait_eventMethod · 0.80
make_scalar_dtMethod · 0.80
change_streamMethod · 0.80

Tested by

no test coverage detected