aboutsummaryrefslogtreecommitdiff
path: root/tests/validation/fixtures/DirectConvolutionLayerFixture.h
diff options
context:
space:
mode:
authorJaroslaw Rzepecki <jaroslaw.rzepecki@arm.com>2017-11-29 13:51:34 +0000
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:41:58 +0000
commit2ecbadada0d2b5e48eb4ffd0ae5e3390c0c96db5 (patch)
treeb838193bc40254726afb242dcdda6ec9205f05f2 /tests/validation/fixtures/DirectConvolutionLayerFixture.h
parentb81fa60a6a78aea2f8e30dd7f2a495b510b4f918 (diff)
downloadComputeLibrary-2ecbadada0d2b5e48eb4ffd0ae5e3390c0c96db5.tar.gz
IVGCVSW-656 : added support (and unit tests) for asymmetric padding in
dirct conv (CL) Change-Id: I4b8389376e675bfa93b4a1ae7c8e65b8db1f4c4b Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/111102 Tested-by: BSG Visual Compute Jenkins server to access repositories on http://mpd-gerrit.cambridge.arm.com <bsgcomp@arm.com> Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com> Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'tests/validation/fixtures/DirectConvolutionLayerFixture.h')
-rw-r--r--tests/validation/fixtures/DirectConvolutionLayerFixture.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/validation/fixtures/DirectConvolutionLayerFixture.h b/tests/validation/fixtures/DirectConvolutionLayerFixture.h
index b78f13acd1..4916c3335b 100644
--- a/tests/validation/fixtures/DirectConvolutionLayerFixture.h
+++ b/tests/validation/fixtures/DirectConvolutionLayerFixture.h
@@ -65,6 +65,20 @@ public:
_reference = compute_reference(input_shape, weights_shape, bias_shape, output_shape, info, data_type, bias_data_type, fractional_bits, quantization_info);
}
+ template <typename...>
+ void setup(TensorShape input_shape, TensorShape weights_shape, TensorShape bias_shape, TensorShape output_shape, PadStrideInfo info,
+ DataType data_type, int fractional_bits, QuantizationInfo quantization_info)
+ {
+ _fractional_bits = fractional_bits;
+ _quantization_info = quantization_info;
+ _data_type = data_type;
+
+ const DataType bias_data_type = is_data_type_quantized_asymmetric(data_type) ? DataType::S32 : data_type;
+
+ _target = compute_target(input_shape, weights_shape, bias_shape, output_shape, info, data_type, bias_data_type, fractional_bits, quantization_info);
+ _reference = compute_reference(input_shape, weights_shape, bias_shape, output_shape, info, data_type, bias_data_type, fractional_bits, quantization_info);
+ }
+
protected:
template <typename U>
void fill(U &&tensor, int i)
@@ -207,6 +221,30 @@ public:
}
};
+template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
+class DirectConvolutionValidationWithTensorShapesQuantizedFixture : public DirectConvolutionValidationGenericFixture<TensorType, AccessorType, FunctionType, T>
+{
+public:
+ template <typename...>
+ void setup(TensorShape input_shape, TensorShape weights_shape, TensorShape bias_shape, TensorShape output_shape, PadStrideInfo info,
+ DataType data_type, QuantizationInfo quantization_info)
+ {
+ DirectConvolutionValidationGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(input_shape, weights_shape, bias_shape, output_shape, info, data_type, 0, quantization_info);
+ }
+};
+
+template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
+class DirectConvolutionValidationWithTensorShapesFixture : public DirectConvolutionValidationGenericFixture<TensorType, AccessorType, FunctionType, T>
+{
+public:
+ template <typename...>
+ void setup(TensorShape input_shape, TensorShape weights_shape, TensorShape bias_shape, TensorShape output_shape, PadStrideInfo info,
+ DataType data_type)
+ {
+ DirectConvolutionValidationGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(input_shape, weights_shape, bias_shape, output_shape, info, data_type, 0, QuantizationInfo());
+ }
+};
+
} // namespace validation
} // namespace test
} // namespace arm_compute