| 7 | using namespace mgb; |
| 8 | |
| 9 | TEST(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 | |
| 23 | TEST(TestOprUtility, VirtualGradCompNode) { |
| 24 | auto cns = load_multiple_xpus(2); |
nothing calls this directly
no test coverage detected