diff options
author | Giorgio Arena <giorgio.arena@arm.com> | 2020-12-17 16:47:07 +0000 |
---|---|---|
committer | Giorgio Arena <giorgio.arena@arm.com> | 2021-01-07 16:41:34 +0000 |
commit | 4bdd177c75789451cad9ba1ecf929214ed75c009 (patch) | |
tree | a6a8ea96045a13af4b29e9c81014516dfe929715 /tests/validation/fixtures/ReduceMeanFixture.h | |
parent | 4d9383e179ed6be8cdb117e6353a0dea1c40be93 (diff) | |
download | ComputeLibrary-4bdd177c75789451cad9ba1ecf929214ed75c009.tar.gz |
Fix fill() for FP data type in fixtures - Part 2
Resolves: COMPMID-4056
Signed-off-by: Giorgio Arena <giorgio.arena@arm.com>
Change-Id: I6623eb9c0e66e52af4e0e9fb386031f4a09125b7
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/4722
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'tests/validation/fixtures/ReduceMeanFixture.h')
-rw-r--r-- | tests/validation/fixtures/ReduceMeanFixture.h | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/validation/fixtures/ReduceMeanFixture.h b/tests/validation/fixtures/ReduceMeanFixture.h index 72887616fe..b7ba942be4 100644 --- a/tests/validation/fixtures/ReduceMeanFixture.h +++ b/tests/validation/fixtures/ReduceMeanFixture.h @@ -58,18 +58,27 @@ protected: template <typename U> void fill(U &&tensor) { - if(!is_data_type_quantized(tensor.data_type())) + if(tensor.data_type() == DataType::F32) { - std::uniform_real_distribution<> distribution(-1.0f, 1.0f); + std::uniform_real_distribution<float> distribution(-1.0f, 1.0f); library->fill(tensor, distribution, 0); } - else + else if(tensor.data_type() == DataType::F16) + { + arm_compute::utils::uniform_real_distribution_fp16 distribution{ half(-1.0f), half(1.0f) }; + library->fill(tensor, distribution, 0); + } + else if(is_data_type_quantized(tensor.data_type())) { std::pair<int, int> bounds = get_quantized_bounds(tensor.quantization_info(), -1.0f, 1.0f); std::uniform_int_distribution<> distribution(bounds.first, bounds.second); library->fill(tensor, distribution, 0); } + else + { + library->fill_tensor_uniform(tensor, 0); + } } TensorType compute_target(TensorShape &src_shape, DataType data_type, Coordinates axis, bool keep_dims, QuantizationInfo quantization_info_input, QuantizationInfo quantization_info_output) |