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

Function TEST_F

dnn/test/naive/svd.cpp:11–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9using namespace test;
10
11TEST_F(NAIVE, SINGULAR_VALUE_DECOMPOSITION) {
12 auto opr = handle()->create_operator<SVDForward>();
13 auto testcases = SVDTestcase::make();
14 for (auto& t : testcases) {
15 // Not supported, skip for now.
16 if (t.m_param.full_matrices)
17 continue;
18
19 auto naive_result = t.run(opr.get());
20 for (size_t i = 0; i < naive_result.s->layout.total_nr_elems(); i++) {
21 EXPECT_GE(naive_result.s->ptr<dt_float32>()[i], 0);
22 }
23 if (t.m_param.compute_uv) {
24 MEGDNN_ASSERT_TENSOR_EQ(*naive_result.recovered_mat, t.m_mat);
25 }
26 }
27}
28
29// vim: syntax=cpp.doxygen

Callers

nothing calls this directly

Calls 4

makeFunction · 0.50
runMethod · 0.45
getMethod · 0.45
total_nr_elemsMethod · 0.45

Tested by

no test coverage detected