[TESTS] Fix random generator for custom signed types (#20393)

* [TESTS] Fix random generator for custom signed types

* Increase threashold for bf16 CPU tests
This commit is contained in:
Vladimir Paramuzov 2023-10-12 13:15:59 +04:00 committed by GitHub
parent ddaf8e80f9
commit 4da61fc7e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -80,6 +80,10 @@ protected:
}
auto normalize = builder::makeNormalizeL2(params[0], axes, eps, epsMode);
function = makeNgraphFunction(inType, params, normalize, "Normalize");
if (inType == ov::element::bf16) {
abs_threshold = 1e-1f;
}
}
void generate_inputs(const std::vector<ngraph::Shape>& targetInputStaticShapes) override {

View File

@ -5,6 +5,7 @@
#pragma once
#include <cmath>
#include <limits>
#include <random>
#include <utility>
@ -223,7 +224,7 @@ void inline fill_data_random(T* pointer,
const uint32_t k_range = k * range; // range with respect to k
random.Generate(k_range);
if (start_from < 0 && !std::is_signed<T>::value) {
if (start_from < 0 && !std::numeric_limits<T>::is_signed) {
start_from = 0;
}
for (std::size_t i = 0; i < size; i++) {