Skip to content

Commit 69db4d5

Browse files
committed
Fixed linter issues
1 parent e12266e commit 69db4d5

4 files changed

Lines changed: 15 additions & 10 deletions

File tree

backends/openvino/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ add_library(openvino_backend STATIC)
3636

3737
# Enable exceptions and RTTI for OpenVINO backend
3838
target_compile_options(
39-
openvino_backend PRIVATE
40-
$<$<CXX_COMPILER_ID:MSVC>:/GR /EHsc>
41-
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-frtti -fexceptions>
39+
openvino_backend
40+
PRIVATE $<$<CXX_COMPILER_ID:MSVC>:/GR /EHsc>
41+
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-frtti -fexceptions>
4242
)
4343

4444
# Add source files for OpenVINO backend

backends/openvino/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ Follow the steps below to setup your build environment:
110110
python -m venv env
111111
env\Scripts\Activate.ps1
112112
```
113-
2. **Clone ExecuTorch Repository from Github**
113+
2. **Clone ExecuTorch Repository from GitHub**
114114
- On Windows, enable symlinks before cloning. Refer to [Building from Source](https://docs.pytorch.org/executorch/main/using-executorch-building-from-source.html#environment-setup) for more details.
115115
- Clone Executorch repository by executing the command below.
116116
```bash

backends/openvino/runtime/OpenvinoBackend.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ constexpr const char* kDefaultLibName = "libopenvino_c.so";
3232
template <typename FuncPtr>
3333
FuncPtr load_symbol(void* handle, const char* name) {
3434
#ifdef _WIN32
35-
void* sym =
36-
reinterpret_cast<void*>(GetProcAddress(static_cast<HMODULE>(handle), name));
35+
void* sym = reinterpret_cast<void*>(
36+
GetProcAddress(static_cast<HMODULE>(handle), name));
3737
if (!sym) {
3838
ET_LOG(
3939
Error,
@@ -70,8 +70,8 @@ bool OpenvinoBackend::ensure_loaded() const {
7070
ET_LOG(
7171
Error,
7272
"OpenVINO runtime not found (LoadLibrary failed: error %lu). "
73-
"Ensure 'openvino_c.dll' is on your PATH "
74-
"(set OPENVINO_LIB_PATH), or install with: "
73+
"Set OPENVINO_LIB_PATH to the full path of 'openvino_c.dll', "
74+
"or add its containing directory to PATH, or install with: "
7575
"pip install \"openvino>=2025.1.0,<2026.0.0\"",
7676
GetLastError());
7777
return;

extension/pybindings/portable_lib.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
# pyre-strict
88

9+
910
"""API for loading and executing ExecuTorch PTE files using the C++ runtime.
1011
1112
.. warning::
@@ -29,13 +30,15 @@
2930
# the pybindings shared library extension. This will load libtorch.so and
3031
# related libs, ensuring that the pybindings lib can resolve those runtime
3132
# dependencies.
33+
3234
import torch as _torch
3335

3436
logger = logging.getLogger(__name__)
3537

3638
# Auto-discover the OpenVINO C library path from the pip-installed openvino
3739
# package so the C++ backend's dlopen/LoadLibrary call works without the user
3840
# having to set LD_LIBRARY_PATH or OPENVINO_LIB_PATH manually.
41+
3942
if not os.environ.get("OPENVINO_LIB_PATH"):
4043
try:
4144
import glob
@@ -64,25 +67,26 @@
6467
del _ov_libs, _ov_libs_dir, _lib_pattern, _ov_dir, spec
6568
except Exception as e:
6669
logger.debug("OpenVINO auto-discovery failed: %s", e)
67-
6870
# Update the DLL search path on Windows. This is the recommended way to handle native
6971
# extensions.
72+
7073
if sys.platform == "win32":
7174
try:
7275
# The extension DLL should be in the same directory as this file.
76+
7377
pybindings_dir = os.path.dirname(os.path.abspath(__file__))
7478
os.add_dll_directory(pybindings_dir)
7579
except Exception as e:
7680
logger.error(
7781
"Failed to add the pybinding extension DLL to the search path. The extension may not work.",
7882
e,
7983
)
80-
8184
# Let users import everything from the C++ _portable_lib extension as if this
8285
# python file defined them. Although we could import these dynamically, it
8386
# wouldn't preserve the static type annotations.
8487
#
8588
# Note that all of these are experimental, and subject to change without notice.
89+
8690
from executorch.extension.pybindings._portable_lib import ( # noqa: F401
8791
# Disable "imported but unused" (F401) checks.
8892
_create_profile_block, # noqa: F401
@@ -109,6 +113,7 @@
109113

110114
# Clean up so that `dir(portable_lib)` is the same as `dir(_portable_lib)`
111115
# (apart from some __dunder__ names).
116+
112117
del _torch
113118
del _exir_warnings
114119
del _warnings

0 commit comments

Comments
 (0)