| 9 | |
| 10 | #if MGB_ENABLE_EXCEPTION |
| 11 | TEST(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 | |
| 24 | TEST(TestGraph, ForceUpdate1) { |
nothing calls this directly
no test coverage detected