Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tests] Remove raising error when graph is not existed #2744

Merged
merged 3 commits into from
Jun 18, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions tests/openvino/native/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import torch
from packaging import version

import nncf
from nncf import Dataset
from nncf.openvino.graph.nncf_graph_builder import GraphConverter
from tests.openvino.conftest import OPENVINO_NATIVE_TEST_ROOT
Expand Down Expand Up @@ -96,10 +95,12 @@ def get_openvino_version() -> str:
def get_actual_reference_for_current_openvino(rel_path: Path) -> Path:
"""
Get path to actual reference file.
If from all of the OpenVINO versions such rel_path is not existed,
than the path for current OpenVINO version is returned.

:param rel_path: Relative path to reference file.

:return: Path to reference file or raise RuntimeError.
:return: Path to a reference file.
"""
root_dir = OPENVINO_NATIVE_TEST_ROOT / "data"
current_ov_version = version.parse(get_openvino_version())
Expand All @@ -119,5 +120,4 @@ def is_valid_version(dir_path: Path) -> bool:
file_name = root_version / rel_path
if file_name.is_file():
return file_name

raise nncf.InternalError(f"Not found file {root_dir}/{current_ov_version}/{rel_path}")
return current_ov_version / rel_path
Loading