From ed04f49d4140f765b5571aba275ce44ff8b252b7 Mon Sep 17 00:00:00 2001 From: liuqi Date: Fri, 3 Nov 2017 16:00:55 +0800 Subject: [PATCH] Add conv 1x1 unit test. --- mace/kernels/opencl/cl/conv_2d_3x3.cl | 2 +- mace/kernels/opencl/cl/depthwise_conv_3x3.cl | 2 +- mace/ops/conv_2d_test.cc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mace/kernels/opencl/cl/conv_2d_3x3.cl b/mace/kernels/opencl/cl/conv_2d_3x3.cl index 0dbafb2d..c51cc2b6 100644 --- a/mace/kernels/opencl/cl/conv_2d_3x3.cl +++ b/mace/kernels/opencl/cl/conv_2d_3x3.cl @@ -33,7 +33,7 @@ void kernel conv_2d_3x3(global const float *input, const float *input_base = input + in_offset + in_pixel_begin; float *output_base = output + out_offset + out_pixel_begin; - uint pixels = out_pixel_end - out_pixel_begin; + const int pixels = out_pixel_end - out_pixel_begin; for (int i = out_chan_begin; i < out_chan_end; ++i) { float *output_ptr = output_base + i * out_pixel; diff --git a/mace/kernels/opencl/cl/depthwise_conv_3x3.cl b/mace/kernels/opencl/cl/depthwise_conv_3x3.cl index 52905289..9f9a6fc4 100644 --- a/mace/kernels/opencl/cl/depthwise_conv_3x3.cl +++ b/mace/kernels/opencl/cl/depthwise_conv_3x3.cl @@ -35,7 +35,7 @@ void kernel depthwise_conv_3x3(global const float *input, /* n, c, h, w */ const float *input_base = input + in_offset + in_pixel_begin; float *output_base = output + out_offset + out_pixel_begin; - uint pixels = out_pixel_end - out_pixel_begin; + const int pixels = out_pixel_end - out_pixel_begin; for (int i = out_chan_begin; i < out_chan_end; ++i) { float bias_value = bias[i]; diff --git a/mace/ops/conv_2d_test.cc b/mace/ops/conv_2d_test.cc index aff87a1a..31d3130a 100644 --- a/mace/ops/conv_2d_test.cc +++ b/mace/ops/conv_2d_test.cc @@ -296,7 +296,7 @@ static void TestUnalignedConvNxNS12() { ExpectTensorNear(expected, *net.GetOutput("Output"), 0.001); }; - for (int kernel_size : {3}) { + for (int kernel_size : {1, 3, 5}) { for (int stride : {1, 2}) { func(kernel_size, kernel_size, stride, stride, VALID); func(kernel_size, kernel_size, stride, stride, SAME); -- GitLab