| 7 | namespace test { |
| 8 | |
| 9 | TEST_F(NAIVE, GENERALNORM_FORWARD_FP32) { |
| 10 | Checker<GeneralNorm> checker(handle(), true); |
| 11 | |
| 12 | GeneralNorm::Param param; |
| 13 | param.affine = true; |
| 14 | |
| 15 | param.axis_start = 0; |
| 16 | param.axis_end = 1; |
| 17 | checker.set_param(param).exect( |
| 18 | Testcase{ |
| 19 | TensorValue( |
| 20 | {2, 3, 2, 1}, dtype::Float32(), |
| 21 | {3.3179, 0.109, -0.5855, 0.2566, -1.2897, 1.2683, -2.0587, |
| 22 | 0.0711, -0.1169, 0.2509, -0.2393, 0.0876}), // input |
| 23 | TensorValue({2}, dtype::Float32(), {1., 1.}), // hx |
| 24 | TensorValue({2}, dtype::Float32(), {0., 0.}), // cx |
| 25 | {}, |
| 26 | {}, |
| 27 | {}}, |
| 28 | Testcase{ |
| 29 | {}, |
| 30 | {}, |
| 31 | {}, |
| 32 | TensorValue( |
| 33 | {2, 3, 2, 1}, dtype::Float32(), |
| 34 | {0.999999, 0.986361, -0.999909, 0.669477, -0.999982, |
| 35 | 0.999986, -0.999999, -0.986361, 0.999909, -0.669477, |
| 36 | 0.999982, -0.999986}), // output |
| 37 | TensorValue( |
| 38 | {3, 2, 1}, dtype::Float32(), |
| 39 | {0.629600, 0.090050, -0.351200, 0.253750, -0.764500, |
| 40 | 0.677950}), // mean |
| 41 | TensorValue( |
| 42 | {3, 2, 1}, dtype::Float32(), |
| 43 | {0.371982, 52.050690, 4.267644, 234.904434, 1.904002, |
| 44 | 1.693886}) // var |
| 45 | }); |
| 46 | checker.set_param(param).exect( |
| 47 | Testcase{ |
| 48 | TensorValue( |
| 49 | {2, 3, 2, 1}, dtype::Float32(), |
| 50 | {3.3179, 0.109, -0.5855, 0.2566, -1.2897, 1.2683, -2.0587, |
| 51 | 0.0711, -0.1169, 0.2509, -0.2393, 0.0876}), // input |
| 52 | TensorValue({2}, dtype::Float32(), {1., 1.}), // hx |
| 53 | TensorValue({2}, dtype::Float32(), {1., 1.}), // cx |
| 54 | {}, |
| 55 | {}, |
| 56 | {}}, |
| 57 | Testcase{ |
| 58 | {}, |
| 59 | {}, |
| 60 | {}, |
| 61 | TensorValue( |
| 62 | {2, 3, 2, 1}, dtype::Float32(), |
| 63 | {1.999999, 1.986361, 0.000091, 1.669477, 0.000018, 1.999986, |
| 64 | 0.000001, 0.013639, 1.999909, 0.330523, 1.999982, |
| 65 | 0.000014}), // output |
| 66 | TensorValue( |
nothing calls this directly
no test coverage detected