Skip to content

Commit

Permalink
[LayerTests] Added handling of a boolean results (openvinotoolkit#25391)
Browse files Browse the repository at this point in the history
### Details:
- Difference in boolean results was causing an unexpected issue while
validation. We don't need to know max difference of a boolean array,
just highlight it exists.

### Tickets:
 - 137495

---------

Co-authored-by: Evgenya Nugmanova <[email protected]>
  • Loading branch information
gkrivor and jane-intel authored Jul 5, 2024
1 parent 27c872f commit 8217df5
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions tests/layer_tests/common/layer_test_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,19 +167,21 @@ def compare_ie_results_with_framework(self, infer_res, framework_res, framework_
is_ok = True
from common.utils.common_utils import allclose
for framework_out_name in framework_res:
ie_out_name = framework_out_name
if ie_out_name not in infer_res and len(infer_res) == 1:
if framework_out_name not in infer_res and len(infer_res) == 1:
ie_res = list(infer_res.values())[0]
else:
ie_res = infer_res[ie_out_name]
ie_res = infer_res[framework_out_name]

if not allclose(ie_res, framework_res[framework_out_name],
atol=framework_eps,
rtol=framework_eps):
is_ok = False
print("Max diff is {}".format(
np.array(
abs(infer_res[ie_out_name] - framework_res[framework_out_name])).max()))
if ie_res.dtype != bool:
print("Max diff is {}".format(
np.array(
abs(ie_res - framework_res[framework_out_name])).max()))
else:
print("Boolean results are not equal")
else:
print("Accuracy validation successful!\n")
print("absolute eps: {}, relative eps: {}".format(framework_eps, framework_eps))
Expand Down

0 comments on commit 8217df5

Please sign in to comment.