aboutsummaryrefslogtreecommitdiff
path: root/reference_model/test/verify_tests.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'reference_model/test/verify_tests.cpp')
-rw-r--r--reference_model/test/verify_tests.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/reference_model/test/verify_tests.cpp b/reference_model/test/verify_tests.cpp
index e7d6c4e..31e27c0 100644
--- a/reference_model/test/verify_tests.cpp
+++ b/reference_model/test/verify_tests.cpp
@@ -392,7 +392,7 @@ TEST_CASE("positive - ulp")
const auto elementCount = std::accumulate(std::begin(shape), std::end(shape), 1, std::multiplies<>());
// Generate some random floats using the full range of fp32.
- auto data_fp32 = generateRandomTensorData<float>(elementCount, false);
+ auto data_fp32 = generateRandomTensorData<float>(elementCount, true);
std::vector<double> data_fp64(data_fp32.begin(), data_fp32.end());
SUBCASE("same")
@@ -400,7 +400,7 @@ TEST_CASE("positive - ulp")
// Generate some data that meets the ULP requirements of the result.
auto otherData_fp32 = data_fp32;
std::for_each(std::begin(otherData_fp32), std::end(otherData_fp32), [](auto& value) {
- if (std::abs(value) != 0.0 && !std::isinf(value))
+ if (std::abs(value) != 0.0 && !std::isinf(value) && !std::isnan(value))
value = increment(value, 5);
});
const auto referenceTensor =
@@ -415,7 +415,7 @@ TEST_CASE("positive - ulp")
// Generate some data that exceeds a specified number of ULP for each value in the tensor.
auto otherData_fp32 = data_fp32;
std::for_each(std::begin(otherData_fp32), std::end(otherData_fp32), [](auto& value) {
- if (std::abs(value) != 0.0 && !std::isinf(value))
+ if (std::abs(value) != 0.0 && !std::isinf(value) && !std::isnan(value))
value = increment(value, 6);
});