| 25 | |
| 26 | #ifdef USE_DNNL |
| 27 | TEST(DNNLOperationPooling, Forward) { |
| 28 | const size_t batchsize = 2, c = 1, h = 3, w = 3; |
| 29 | const float x[batchsize * c * h * w] = {1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, |
| 30 | 7.0f, 8.0f, 9.0f, 1.0f, 2.0f, 3.0f, |
| 31 | 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f}; |
| 32 | |
| 33 | Tensor in(Shape{batchsize, c, h, w}); |
| 34 | in.CopyDataFromHostPtr(x, batchsize * c * h * w); |
| 35 | |
| 36 | PoolingHandle pool_handle(in, {2, 2}, {1, 1}, {0, 0}, true); |
| 37 | Tensor out1 = CpuPoolingForward(pool_handle, in); |
| 38 | } |
| 39 | TEST(DNNLOperationPooling, ForwardAverage) { |
| 40 | const size_t batchsize = 2, c = 1, h = 3, w = 3; |
| 41 | const float x[batchsize * c * h * w] = { |
nothing calls this directly
no test coverage detected