1
0
mirror of synced 2024-12-23 13:20:22 +01:00
TheChymera-overlay/sci-libs/pytorch/files/pytorch-1.6.0-global-dlopen.patch

16 lines
592 B
Diff
Raw Normal View History

Don't hardcode the library path. Leave it to the dynamic loader.
Index: pytorch-1.6.0/torch/__init__.py
===================================================================
--- pytorch-1.6.0.orig/torch/__init__.py
+++ pytorch-1.6.0/torch/__init__.py
@@ -138,7 +138,7 @@ def _load_global_deps():
here = os.path.abspath(__file__)
lib_path = os.path.join(os.path.dirname(here), 'lib', lib_name)
- ctypes.CDLL(lib_path, mode=ctypes.RTLD_GLOBAL)
+ ctypes.CDLL(lib_name, mode=ctypes.RTLD_GLOBAL)
if (USE_RTLD_GLOBAL_WITH_LIBTORCH or os.getenv('TORCH_USE_RTLD_GLOBAL')) and \