diff options
author | Pablo Palmier <Pablo.Palmier@arm.com> | 2017-10-05 15:01:34 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:42:17 +0000 |
commit | a2b89ca5407532257a959ad1852f29187e1be4ac (patch) | |
tree | a202070aea45a81ec1ea8a86fa4047035eb2d567 /tests/validation/fixtures | |
parent | 5948634bb97e05934e9eea180ba41dcddf874416 (diff) | |
download | ComputeLibrary-a2b89ca5407532257a959ad1852f29187e1be4ac.tar.gz |
IVGCVSW-631 Neon support for Softmax beta parameter (F32 only)
Change-Id: Ibf6f038b39f1a4e557f5d04feb08e3d5ef54e223
Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/112019
Tested-by: BSG Visual Compute Jenkins server to access repositories on http://mpd-gerrit.cambridge.arm.com <bsgcomp@arm.com>
Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Diffstat (limited to 'tests/validation/fixtures')
-rw-r--r-- | tests/validation/fixtures/SoftmaxLayerFixture.h | 38 |
1 files changed, 26 insertions, 12 deletions
diff --git a/tests/validation/fixtures/SoftmaxLayerFixture.h b/tests/validation/fixtures/SoftmaxLayerFixture.h index 3ffbc6aac7..c2ab2e2ef6 100644 --- a/tests/validation/fixtures/SoftmaxLayerFixture.h +++ b/tests/validation/fixtures/SoftmaxLayerFixture.h @@ -47,13 +47,13 @@ class SoftmaxValidationGenericFixture : public framework::Fixture { public: template <typename...> - void setup(TensorShape shape, DataType data_type, int fractional_bits, QuantizationInfo quantization_info) + void setup(TensorShape shape, DataType data_type, int fractional_bits, QuantizationInfo quantization_info, float beta) { _fractional_bits = fractional_bits; _quantization_info = quantization_info; - _target = compute_target(shape, data_type, fractional_bits, quantization_info); - _reference = compute_reference(shape, data_type, fractional_bits, quantization_info); + _target = compute_target(shape, data_type, fractional_bits, quantization_info, beta); + _reference = compute_reference(shape, data_type, fractional_bits, quantization_info, beta); } protected: @@ -78,7 +78,8 @@ protected: } } - TensorType compute_target(const TensorShape &shape, DataType data_type, int fixed_point_position, QuantizationInfo quantization_info) + TensorType compute_target(const TensorShape &shape, DataType data_type, int fixed_point_position, + QuantizationInfo quantization_info, float beta) { // Create tensors TensorType src = create_tensor<TensorType>(shape, data_type, 1, fixed_point_position, quantization_info); @@ -86,7 +87,7 @@ protected: // Create and configure function FunctionType smx_layer; - smx_layer.configure(&src, &dst); + smx_layer.configure(&src, &dst, beta); ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS); ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS); @@ -107,7 +108,8 @@ protected: return dst; } - SimpleTensor<T> compute_reference(const TensorShape &shape, DataType data_type, int fixed_point_position, QuantizationInfo quantization_info) + SimpleTensor<T> compute_reference(const TensorShape &shape, DataType data_type, int fixed_point_position, + QuantizationInfo quantization_info, float beta) { // Create reference SimpleTensor<T> src{ shape, data_type, 1, fixed_point_position, quantization_info }; @@ -115,7 +117,7 @@ protected: // Fill reference fill(src); - return reference::softmax_layer<T>(src); + return reference::softmax_layer<T>(src, beta); } TensorType _target{}; @@ -129,9 +131,13 @@ class SoftmaxValidationFixture : public SoftmaxValidationGenericFixture<TensorTy { public: template <typename...> - void setup(TensorShape shape, DataType data_type) + void setup(TensorShape shape, DataType data_type, float beta) { - SoftmaxValidationGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(shape, data_type, 0, QuantizationInfo()); + SoftmaxValidationGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(shape, + data_type, + 0, + QuantizationInfo(), + beta); } }; @@ -142,7 +148,11 @@ public: template <typename...> void setup(TensorShape shape, DataType data_type, int fixed_point_position) { - SoftmaxValidationGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(shape, data_type, fixed_point_position, QuantizationInfo()); + SoftmaxValidationGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(shape, + data_type, + fixed_point_position, + QuantizationInfo(), + 1.0f); } }; @@ -151,9 +161,13 @@ class SoftmaxValidationQuantizedFixture : public SoftmaxValidationGenericFixture { public: template <typename...> - void setup(TensorShape shape, DataType data_type, QuantizationInfo quantization_info) + void setup(TensorShape shape, DataType data_type, QuantizationInfo quantization_info, float beta) { - SoftmaxValidationGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(shape, data_type, 0, quantization_info); + SoftmaxValidationGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(shape, + data_type, + 0, + quantization_info, + beta); } }; } // namespace validation |