MCPcopy Create free account
hub / github.com/apache/singa / TEST

Function TEST

test/singa/test_operation_pooling.cc:27–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25
26#ifdef USE_DNNL
27TEST(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}
39TEST(DNNLOperationPooling, ForwardAverage) {
40 const size_t batchsize = 2, c = 1, h = 3, w = 3;
41 const float x[batchsize * c * h * w] = {

Callers

nothing calls this directly

Calls 3

CpuPoolingForwardFunction · 0.85
CpuPoolingBackwardFunction · 0.85
CopyDataFromHostPtrMethod · 0.45

Tested by

no test coverage detected