| 7 | using namespace test; |
| 8 | |
| 9 | TEST_F(NAIVE, LSQ_FORWARD) { |
| 10 | Checker<LSQ> checker(handle(), /* check_dispatch */ false); |
| 11 | |
| 12 | param::LSQ param; |
| 13 | |
| 14 | param.qmin = -127; |
| 15 | param.qmax = 127; |
| 16 | |
| 17 | TensorND input = TensorValue( |
| 18 | {2, 2, 2, 2}, dtype::Float32(), |
| 19 | {0, 1, 3, 4, 1, 2, 4, 5, 3, 4, 6, 7, 4, 5, 7, 8}); |
| 20 | |
| 21 | TensorND scale_shape = TensorValue({1}, dtype::Float32(), {2}); |
| 22 | |
| 23 | TensorND zero_point = TensorValue({1}, dtype::Float32(), {1}); |
| 24 | |
| 25 | TensorND grad_scale = TensorValue({1}, dtype::Float32(), {0.5}); |
| 26 | |
| 27 | TensorND output = TensorValue( |
| 28 | {2, 2, 2, 2}, dtype::Float32(), |
| 29 | {0, 2, 4, 4, 2, 2, 4, 6, 4, 4, 6, 8, 4, 6, 8, 8}); |
| 30 | |
| 31 | checker.set_param(param).exect( |
| 32 | Testcase{input, scale_shape, zero_point, grad_scale, {}}, |
| 33 | Testcase{{}, {}, {}, {}, output}); |
| 34 | } |
nothing calls this directly
no test coverage detected