diff options
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{}; |