File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 13
13
This API is experimental and subject to change without notice.
14
14
"""
15
15
16
+ import os
17
+ import sys
16
18
import warnings as _warnings
17
19
18
20
import executorch .exir ._warnings as _exir_warnings
28
30
# dependencies.
29
31
import torch as _torch
30
32
33
+ # Update the DLL search path on Windows. This is the recommended way to handle native
34
+ # extensions.
35
+ if sys .platform == "win32" :
36
+ # The extension DLL should be in the same directory as this file.
37
+ pybindings_dir = os .path .dirname (__file__ )
38
+ os .add_dll_directory (pybindings_dir )
39
+
31
40
# Let users import everything from the C++ _portable_lib extension as if this
32
41
# python file defined them. Although we could import these dynamically, it
33
42
# wouldn't preserve the static type annotations.
You can’t perform that action at this time.
0 commit comments