1 # Copyright © 2020 Arm Ltd. All rights reserved.
3 # SPDX-License-Identifier: MIT
6 version_info = (22, 0, 0)
8 __dev_version_env = os.getenv("PYARMNN_DEV_VER", "")
11 __dev_version = "dev0"
13 __dev_version = "dev{}".format(int(__dev_version_env))
15 __dev_version = str(__dev_version_env)
17 version_info = (*version_info, __dev_version)
19 __version__ = '.'.join(str(c) for c in version_info)
20 __arm_ml_version__ = '{}.{}.{}'.format(version_info[0], version_info[1], version_info[2])
23 def check_armnn_version(installed_armnn_version: str, expected_armnn_version: str = __arm_ml_version__):
24 """Compares expected Arm NN version and Arm NN version used to build the package.
27 installed_armnn_version (str): Arm NN version used to generate the package (e.g. 22.0.0)
28 expected_armnn_version (str): Expected Arm NN version
33 expected = expected_armnn_version.split('.', 2)
34 installed = installed_armnn_version.split('.', 2)
36 # only compare major and minor versions, not patch
37 assert (expected[0] == installed[0]) and (expected[1] == installed[1]), \
38 "Expected ArmNN version is {} but installed ArmNN version is {}".format(expected_armnn_version, installed_armnn_version)