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

Function TEST_F

dnn/test/naive/lamb.cpp:10–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8using namespace test;
9
10TEST_F(NAIVE, LAMBUpdate) {
11 Checker<LAMBUpdate> checker(handle(), false);
12 LAMBUpdate::Param param;
13 param.beta_1 = 0;
14 param.beta_2 = 0;
15 param.eps = 0;
16 param.weight_decay = 0;
17 param.lr = 1;
18 param.step = 1;
19 param.bias_correction = true;
20 param.always_adapt = false;
21
22 TensorND m_t_1 = TensorValue({2}, dtype::Float32(), {1, 1});
23 TensorND v_t_1 = TensorValue({2}, dtype::Float32(), {1, 1});
24 TensorND param_lamb = TensorValue({2}, dtype::Float32(), {1, 1});
25 TensorND grad = TensorValue({2}, dtype::Float16(), {1, 1});
26
27 TensorND m_t = TensorValue({2}, dtype::Float32(), {1, 1});
28 TensorND v_t = TensorValue({2}, dtype::Float32(), {1, 1});
29 TensorND new_param = TensorValue({2}, dtype::Float32(), {0, 0});
30 checker.set_param(param).exect(
31 Testcase{m_t_1, v_t_1, param_lamb, grad, {}, {}, {}},
32 Testcase{{}, {}, {}, {}, m_t, v_t, new_param});
33}

Callers

nothing calls this directly

Calls 2

TensorValueFunction · 0.85
exectMethod · 0.80

Tested by

no test coverage detected