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/DepthToSpaceLayerFixture.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/DepthToSpaceLayerFixture.h')
-rw-r--r-- | tests/validation/fixtures/DepthToSpaceLayerFixture.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/validation/fixtures/DepthToSpaceLayerFixture.h b/tests/validation/fixtures/DepthToSpaceLayerFixture.h index 8c2f5610a3..bc9954a0bd 100644 --- a/tests/validation/fixtures/DepthToSpaceLayerFixture.h +++ b/tests/validation/fixtures/DepthToSpaceLayerFixture.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 Arm Limited. + * Copyright (c) 2019-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -50,7 +50,10 @@ protected: template <typename U> void fill(U &&tensor, int i) { - std::uniform_real_distribution<> distribution(-1.0f, 1.0f); + static_assert(std::is_floating_point<T>::value || std::is_same<T, half>::value, "Only floating point data types supported."); + using DistributionType = typename std::conditional<std::is_same<T, half>::value, arm_compute::utils::uniform_real_distribution_fp16, std::uniform_real_distribution<T>>::type; + + DistributionType distribution{ T(-1.0f), T(1.0f) }; library->fill(tensor, distribution, i); } TensorType compute_target(TensorShape input_shape, int32_t block_shape, TensorShape output_shape, |