Skip to content

Commit 7eeeb86

Browse files
authored
Cortex-M backend: Remove cmsis_nn check in passes/__init__ (#20445)
#20371 removed the need for it, but missed actually removing it.
1 parent 2f78fdc commit 7eeeb86

1 file changed

Lines changed: 0 additions & 30 deletions

File tree

backends/cortex_m/passes/__init__.py

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,6 @@
33
# This source code is licensed under the BSD-style license found in the
44
# LICENSE file in the root directory of this source tree.
55

6-
from importlib.util import find_spec
7-
8-
9-
def _missing_dependencies_error(missing: str) -> ModuleNotFoundError:
10-
return ModuleNotFoundError(
11-
"Cortex-M backend dependencies are not installed "
12-
f"(missing: {missing}). Install ExecuTorch with "
13-
"`pip install executorch[cortex_m]`, or if building from source run "
14-
"`examples/arm/setup.sh --i-agree-to-the-contained-eula`."
15-
)
16-
17-
18-
def _ensure_cortex_m_dependencies() -> None:
19-
required_modules = {
20-
"cmsis_nn": "cmsis_nn",
21-
}
22-
missing_packages = []
23-
for module_name, package_name in required_modules.items():
24-
try:
25-
if find_spec(module_name) is None:
26-
missing_packages.append(package_name)
27-
except (ImportError, ValueError):
28-
missing_packages.append(package_name)
29-
30-
if missing_packages:
31-
raise _missing_dependencies_error(", ".join(missing_packages))
32-
33-
34-
_ensure_cortex_m_dependencies()
35-
366
from .cortex_m_pass import CortexMPass # noqa # usort: skip
377
from .activation_fusion_pass import ActivationFusionPass # noqa
388
from .aten_to_cortex_m_pass import AtenToCortexMPass # noqa

0 commit comments

Comments
 (0)