aboutsummaryrefslogtreecommitdiff
path: root/tests/validation/reference/DepthwiseConvolutionLayer.cpp
diff options
context:
space:
mode:
authorFrank Lei <frank.lei@arm.com>2018-01-02 16:49:33 +0800
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:42:33 +0000
commit8cdfdb83c89178b5cf654a5b27471950ab1b997e (patch)
tree22dd26543f819bc2214b80f50613eeba70e05271 /tests/validation/reference/DepthwiseConvolutionLayer.cpp
parent02541fb21eca5574fcce012973774a6f213877ee (diff)
downloadComputeLibrary-8cdfdb83c89178b5cf654a5b27471950ab1b997e.tar.gz
APPBROWSER-366: Add DepthwiseConvolutionLayer(fp16 only) support.
Change-Id: I051b7e56b60bf1a55cdf014539ef71346d3aee26 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/114737 Reviewed-by: Anthony Barbier <anthony.barbier@arm.com> Tested-by: Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'tests/validation/reference/DepthwiseConvolutionLayer.cpp')
-rw-r--r--tests/validation/reference/DepthwiseConvolutionLayer.cpp8
1 files changed, 6 insertions, 2 deletions
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<T> depthwise_convolution(const SimpleTensor<T> &src, const SimpleTe
Coordinates coords(static_cast<int>(x), static_cast<int>(y), static_cast<int>(z), static_cast<int>(r));
size_t filter_offset = filter_plane * z;
- T val = 0;
+ T val(0);
for(int j = y - filter_half_height; j <= static_cast<int>(y + filter_half_height); ++j)
{
for(int i = x - filter_half_width; i <= static_cast<int>(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<uint8_t> depthwise_convolution(const SimpleTensor<uint8_t> &src, co
template SimpleTensor<float> depthwise_convolution(const SimpleTensor<float> &src, const SimpleTensor<float> &weights, const SimpleTensor<float> &biases, const TensorShape &dst_shape,
const PadStrideInfo &conv_info);
+
+template SimpleTensor<half> depthwise_convolution(const SimpleTensor<half> &src, const SimpleTensor<half> &weights, const SimpleTensor<half> &biases, const TensorShape &dst_shape,
+ const PadStrideInfo &conv_info);
} // namespace reference
} // namespace validation
} // namespace test