Skip to content

Commit bd5753d

Browse files
digantdesaifacebook-github-bot
authored andcommitted
Arm Backend: Use tosa_ref_model only if it is avaiable
Summary: As Title Reviewed By: kirklandsign Differential Revision: D74420616
1 parent b1b46ee commit bd5753d

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

backends/arm/test/conftest.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,21 @@ def pytest_configure(config):
4444
if getattr(config.option, "fast_fvp", False):
4545
pytest._test_options["fast_fvp"] = config.option.fast_fvp # type: ignore[attr-defined]
4646

47+
pytest._test_options["tosa_version"] = "0.80" # type: ignore[attr-defined]
4748
if config.option.arm_run_tosa_version:
4849
pytest._test_options["tosa_version"] = config.option.arm_run_tosa_version
4950

50-
pytest._test_options["tosa_ref_model"] = True # type: ignore[attr-defined]
51+
# Not all deployments of ET have the TOSA reference model available.
52+
# Make sure we don't try to use it if it's not available.
53+
try:
54+
if pytest._test_options["tosa_version"] == "0.80":
55+
import tosa_tools.v0_80.tosa_reference_model as tosa_reference_model
56+
else:
57+
import tosa_tools.tosa_ref_model as tosa_reference_model
58+
except ImportError:
59+
pytest._test_options["tosa_ref_model"] = False # type: ignore[attr-defined]
60+
tosa_reference_model = None # noqa
61+
5162

5263
logging.basicConfig(level=logging.INFO, stream=sys.stdout)
5364

0 commit comments

Comments
 (0)