From 29ad1d9cfa8adcc5eac61cb144b627ffd9d8a1ac Mon Sep 17 00:00:00 2001 From: Georgy Krivoruchko Date: Fri, 22 Mar 2024 17:10:13 +0400 Subject: [PATCH] Update model_importer.py --- .../onnx/tests/tests_python/utils/model_importer.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/frontends/onnx/tests/tests_python/utils/model_importer.py b/src/frontends/onnx/tests/tests_python/utils/model_importer.py index 41965f3c1923ec..6df72a9e8b445d 100644 --- a/src/frontends/onnx/tests/tests_python/utils/model_importer.py +++ b/src/frontends/onnx/tests/tests_python/utils/model_importer.py @@ -141,16 +141,27 @@ def _execute_pb_data( executed_tests = executed_tests + 1 return executed_tests + def _add_model_import_test(self, model_test: ExtOnnxTestCase) -> None: + # model is loaded at runtime, note sometimes it could even + # never loaded if the test skipped + model_marker = [None] # type: List[Optional[Union[ModelProto, NodeProto]]] + def run_import(test_self: Any, device: Text) -> None: model = ModelImportRunner._load_onnx_model(model_test.model_dir, model_test.model) + model_marker[0] = model_test.model_dir / model_test.model assert import_onnx_model(model) self._add_test("ModelImport", model_test.name, run_import, model_marker) def _add_model_execution_test(self, model_test: ExtOnnxTestCase) -> None: + # model is loaded at runtime, note sometimes it could even + # never loaded if the test skipped + model_marker = [None] # type: List[Optional[Union[ModelProto, NodeProto]]] + def run_execution(test_self: Any, device: Text) -> None: model = ModelImportRunner._load_onnx_model(model_test.model_dir, model_test.model) + model_marker[0] = model_test.model_dir / model_test.model prepared_model = self.backend.prepare(model, device) assert prepared_model is not None executed_tests = ModelImportRunner._execute_npz_data(