From 8cdfdb83c89178b5cf654a5b27471950ab1b997e Mon Sep 17 00:00:00 2001 From: Frank Lei Date: Tue, 2 Jan 2018 16:49:33 +0800 Subject: APPBROWSER-366: Add DepthwiseConvolutionLayer(fp16 only) support. Change-Id: I051b7e56b60bf1a55cdf014539ef71346d3aee26 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/114737 Reviewed-by: Anthony Barbier Tested-by: Jenkins --- tests/validation/reference/DepthwiseConvolutionLayer.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'tests/validation/reference/DepthwiseConvolutionLayer.cpp') diff --git a/tests/validation/reference/DepthwiseConvolutionLayer.cpp b/tests/validation/reference/DepthwiseConvolutionLayer.cpp index 0e88d3dbd3..08caa8efb8 100644 --- a/tests/validation/reference/DepthwiseConvolutionLayer.cpp +++ b/tests/validation/reference/DepthwiseConvolutionLayer.cpp @@ -89,14 +89,15 @@ SimpleTensor depthwise_convolution(const SimpleTensor &src, const SimpleTe Coordinates coords(static_cast(x), static_cast(y), static_cast(z), static_cast(r)); size_t filter_offset = filter_plane * z; - T val = 0; + T val(0); for(int j = y - filter_half_height; j <= static_cast(y + filter_half_height); ++j) { for(int i = x - filter_half_width; i <= static_cast(x + filter_half_width); ++i) { coords.set(0, i); coords.set(1, j); - val += *(weights.data() + filter_offset) * tensor_elem_at(src, coords, BorderMode::CONSTANT, 0.f); + T border_value(0); + val += *(weights.data() + filter_offset) * tensor_elem_at(src, coords, BorderMode::CONSTANT, border_value); ++filter_offset; } } @@ -189,6 +190,9 @@ SimpleTensor depthwise_convolution(const SimpleTensor &src, co template SimpleTensor depthwise_convolution(const SimpleTensor &src, const SimpleTensor &weights, const SimpleTensor &biases, const TensorShape &dst_shape, const PadStrideInfo &conv_info); + +template SimpleTensor depthwise_convolution(const SimpleTensor &src, const SimpleTensor &weights, const SimpleTensor &biases, const TensorShape &dst_shape, + const PadStrideInfo &conv_info); } // namespace reference } // namespace validation } // namespace test -- cgit v1.2.1