From 38624db83f4d9fe015ae44408cdfdbfb6b853df0 Mon Sep 17 00:00:00 2001 From: Maxim Vafin Date: Tue, 19 Mar 2024 18:10:40 +0100 Subject: [PATCH] [PT FE] Fix sporadic issue in quantized tests (#23520) ### Details: - *Relax quantized tests condition to remove sporadicity.* ### Tickets: - *CVS-129734* --- tests/layer_tests/pytorch_tests/pytorch_layer_test_class.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/layer_tests/pytorch_tests/pytorch_layer_test_class.py b/tests/layer_tests/pytorch_tests/pytorch_layer_test_class.py index 8f01faf173efce..3f1b9d1a54ae13 100644 --- a/tests/layer_tests/pytorch_tests/pytorch_layer_test_class.py +++ b/tests/layer_tests/pytorch_tests/pytorch_layer_test_class.py @@ -196,7 +196,8 @@ def numpy_to_torch_recursively(x): if not quantized_ops and n_is_not_close > 0: is_ok = False print("Max diff is {}".format(max_diff)) - elif quantized_ops and (n_is_not_close > int(np.log10(cur_fw_res.size)) or max_diff > np.array(quant_size + fw_eps).max()): + elif quantized_ops and max_diff > np.array(quant_size + fw_eps).max(): + # To remove sporadic issues, allow any number of error of 1 quant is_ok = False print("Errors outside threshold range: {} with max diff {}, expected at most {} with max diff {}".format( n_is_not_close, max_diff, int(np.log10(cur_fw_res.size)), quant_size + fw_eps))