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 1313 This API is experimental and subject to change without notice.
1414"""
1515
16+ import os
17+ import sys
1618import warnings as _warnings
1719
1820import executorch .exir ._warnings as _exir_warnings
2830# dependencies.
2931import torch as _torch
3032
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+
3140# Let users import everything from the C++ _portable_lib extension as if this
3241# python file defined them. Although we could import these dynamically, it
3342# wouldn't preserve the static type annotations.
You can’t perform that action at this time.
0 commit comments