aboutsummaryrefslogtreecommitdiff
path: root/tests/validation/fixtures/ScaleFixture.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/validation/fixtures/ScaleFixture.h')
-rw-r--r--tests/validation/fixtures/ScaleFixture.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/tests/validation/fixtures/ScaleFixture.h b/tests/validation/fixtures/ScaleFixture.h
index 1e66306715..fc09c8f23c 100644
--- a/tests/validation/fixtures/ScaleFixture.h
+++ b/tests/validation/fixtures/ScaleFixture.h
@@ -98,9 +98,15 @@ protected:
template <typename U>
void fill(U &&tensor)
{
- if(is_data_type_float(_data_type))
+ if(tensor.data_type() == DataType::F32)
{
- library->fill_tensor_uniform(tensor, 0);
+ std::uniform_real_distribution<float> distribution(-5.0f, 5.0f);
+ library->fill(tensor, distribution, 0);
+ }
+ else if(tensor.data_type() == DataType::F16)
+ {
+ arm_compute::utils::uniform_real_distribution_fp16 distribution{ half(-5.0f), half(5.0f) };
+ library->fill(tensor, distribution, 0);
}
else if(is_data_type_quantized(tensor.data_type()))
{
@@ -109,9 +115,7 @@ protected:
}
else
{
- // Restrict range for float to avoid any floating point issues
- std::uniform_real_distribution<> distribution(-5.0f, 5.0f);
- library->fill(tensor, distribution, 0);
+ library->fill_tensor_uniform(tensor, 0);
}
}