[PT FE] Fix sporadic issue in round layer tests (#19051)

* [PT FE] Fix sporadic issue in round tests

* Better comment
This commit is contained in:
Maxim Vafin
2023-08-08 16:14:38 +02:00
committed by GitHub
parent 859c03268b
commit 542842b0c0

View File

@@ -10,6 +10,10 @@ class TestRound(PytorchLayerTest):
def _prepare_input(self, out=False, dtype="float32"):
import numpy as np
input = np.random.randn(1, 3, 224, 224).astype(dtype)
if dtype == "float64":
# fp64 can fail by accuracy, because pytorch rounds fp64 value and ov will round fp32 value.
# To remove sporadic accuracy fails we will round the number to 6 decimal places.
input = np.round(input, 6)
if not out:
return (input, )
return (input, np.zeros_like(input))