aboutsummaryrefslogtreecommitdiff
path: root/tests/conftest.py
diff options
context:
space:
mode:
authorNathan Bailey <nathan.bailey@arm.com>2024-01-16 16:39:06 +0000
committerNathan Bailey <nathan.bailey@arm.com>2024-02-09 14:31:46 +0000
commitd08513a72e7fbf0626c3d69b9c4cc7056b3da4ae (patch)
tree3d332d70dbc57b6b7255bb4b429b322ad90bb2c1 /tests/conftest.py
parentbe7bab89eb8ace6ab6a83687354beab156afb716 (diff)
downloadmlia-d08513a72e7fbf0626c3d69b9c4cc7056b3da4ae.tar.gz
feat: Integrate Vela's per-layer performance estimates
Resolves: MLIA-1055, MLIA-1056, MLIA-1057 Signed-off-by: Nathan Bailey <nathan.bailey@arm.com> Change-Id: Id573cec94e4a69117051dcd5175f383c0955d890
Diffstat (limited to 'tests/conftest.py')
-rw-r--r--tests/conftest.py31
1 files changed, 30 insertions, 1 deletions
diff --git a/tests/conftest.py b/tests/conftest.py
index 345eb8d..9dc1d16 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -1,4 +1,4 @@
-# SPDX-FileCopyrightText: Copyright 2022-2023, Arm Limited and/or its affiliates.
+# SPDX-FileCopyrightText: Copyright 2022-2024, Arm Limited and/or its affiliates.
# SPDX-License-Identifier: Apache-2.0
"""Pytest conf module."""
import shutil
@@ -50,6 +50,32 @@ def invalid_input_model_file(test_tflite_invalid_model: Path) -> Path:
return test_tflite_invalid_model
+@pytest.fixture(scope="session", name="empty_test_csv_file")
+def fixture_empty_test_csv_file( # pylint: disable=too-many-locals
+ test_csv_path: Path,
+) -> Path:
+ """Return empty test csv file path."""
+ return test_csv_path / "empty_test_csv_file.csv"
+
+
+@pytest.fixture(scope="session", name="test_csv_file")
+def fixture_test_csv_file( # pylint: disable=too-many-locals
+ test_csv_path: Path,
+) -> Path:
+ """Return test csv file path."""
+ return test_csv_path / "test_csv_file.csv"
+
+
+@pytest.fixture(scope="session", name="test_csv_path")
+def fixture_test_csv_path( # pylint: disable=too-many-locals
+ tmp_path_factory: pytest.TempPathFactory,
+) -> Generator[Path, None, None]:
+ """Return test csv file path."""
+ tmp_path = tmp_path_factory.mktemp("csv_files")
+ yield tmp_path
+ shutil.rmtree(tmp_path)
+
+
def get_test_keras_model() -> tf.keras.Model:
"""Return test Keras model."""
model = tf.keras.Sequential(
@@ -87,6 +113,9 @@ def fixture_test_models_path(
"""Provide path to the test models."""
tmp_path = tmp_path_factory.mktemp("models")
+ # Need an output directory for verbose performance
+ Path("output").mkdir(exist_ok=True)
+
# Keras Model
keras_model = get_test_keras_model()
save_keras_model(keras_model, tmp_path / TEST_MODEL_KERAS_FILE)