diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2017-10-23 20:29:30 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:35:24 +0000 |
commit | 81a26ad6b626ce2da83659d7c6c17b6104d1f203 (patch) | |
tree | 536807115771f1a4b06048892d1d4e17c98779de /tests/validation/fixtures/DepthwiseConvolutionFixture.h | |
parent | 511347a7282b948bddfc071e9a8fa08e79da25b4 (diff) | |
download | ComputeLibrary-81a26ad6b626ce2da83659d7c6c17b6104d1f203.tar.gz |
COMPMID-643: Add bias to CLDepthwiseConvolution.
Change-Id: Ibfe7b8c1172d10cbcae7971fe86b82090519d31d
Reviewed-on: http://mpd-gerrit.cambridge.arm.com/92798
Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com>
Reviewed-by: Jaroslaw Rzepecki <jaroslaw.rzepecki@arm.com>
Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'tests/validation/fixtures/DepthwiseConvolutionFixture.h')
-rw-r--r-- | tests/validation/fixtures/DepthwiseConvolutionFixture.h | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/tests/validation/fixtures/DepthwiseConvolutionFixture.h b/tests/validation/fixtures/DepthwiseConvolutionFixture.h index 4a890f6333..d883807537 100644 --- a/tests/validation/fixtures/DepthwiseConvolutionFixture.h +++ b/tests/validation/fixtures/DepthwiseConvolutionFixture.h @@ -47,10 +47,10 @@ class DepthwiseConvolutionValidationFixture : public framework::Fixture { public: template <typename...> - void setup(TensorShape in_shape, TensorShape weights_shape, TensorShape out_shape, PadStrideInfo pad_stride_info) + void setup(TensorShape in_shape, TensorShape weights_shape, TensorShape biases_shape, TensorShape out_shape, PadStrideInfo pad_stride_info) { - _target = compute_target(in_shape, weights_shape, out_shape, pad_stride_info); - _reference = compute_reference(in_shape, weights_shape, out_shape, pad_stride_info); + _target = compute_target(in_shape, weights_shape, biases_shape, out_shape, pad_stride_info); + _reference = compute_reference(in_shape, weights_shape, biases_shape, out_shape, pad_stride_info); } protected: @@ -70,29 +70,33 @@ protected: } } - TensorType compute_target(const TensorShape &input_shape, const TensorShape &weights_shape, const TensorShape &output_shape, PadStrideInfo &pad_stride_info) + TensorType compute_target(const TensorShape &input_shape, const TensorShape &weights_shape, const TensorShape &biases_shape, const TensorShape &output_shape, PadStrideInfo &pad_stride_info) { // Create tensors TensorType src = create_tensor<TensorType>(input_shape, DataType::F32); TensorType weights = create_tensor<TensorType>(weights_shape, DataType::F32); + TensorType biases = create_tensor<TensorType>(biases_shape, DataType::F32); TensorType dst = create_tensor<TensorType>(output_shape, DataType::F32); // Create Depthwise Convolution configure function FunctionType depthwise_convolution; - depthwise_convolution.configure(&src, &dst, &weights, pad_stride_info); + depthwise_convolution.configure(&src, &dst, &weights, &biases, pad_stride_info); // Allocate tensors src.allocator()->allocate(); weights.allocator()->allocate(); + biases.allocator()->allocate(); dst.allocator()->allocate(); ARM_COMPUTE_EXPECT(!src.info()->is_resizable(), framework::LogLevel::ERRORS); ARM_COMPUTE_EXPECT(!weights.info()->is_resizable(), framework::LogLevel::ERRORS); + ARM_COMPUTE_EXPECT(!biases.info()->is_resizable(), framework::LogLevel::ERRORS); ARM_COMPUTE_EXPECT(!dst.info()->is_resizable(), framework::LogLevel::ERRORS); // Fill tensors fill(AccessorType(src), 0); fill(AccessorType(weights), 1); + fill(AccessorType(biases), 2); // Compute function depthwise_convolution.run(); @@ -100,15 +104,17 @@ protected: return dst; } - SimpleTensor<T> compute_reference(const TensorShape &in_shape, const TensorShape &weights_shape, const TensorShape &out_shape, const PadStrideInfo &pad_stride_info) + SimpleTensor<T> compute_reference(const TensorShape &in_shape, const TensorShape &weights_shape, const TensorShape &biases_shape, const TensorShape &out_shape, const PadStrideInfo &pad_stride_info) { SimpleTensor<T> src(in_shape, DataType::F32); SimpleTensor<T> weights(weights_shape, DataType::F32); + SimpleTensor<T> biases(biases_shape, DataType::F32); fill(src, 0); fill(weights, 1); + fill(biases, 2); - return reference::depthwise_convolution(src, weights, out_shape, pad_stride_info); + return reference::depthwise_convolution(src, weights, biases, out_shape, pad_stride_info); } TensorType _target{}; |