We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 80ed1ff commit 591dcf4Copy full SHA for 591dcf4
pysrc/juliacall/__init__.py
@@ -53,6 +53,15 @@ def init():
53
import ctypes as c
54
import sys
55
import subprocess
56
+ import warnings
57
+
58
+ # importing pytorch before juliacall sometimes causes segfaults. TODO: remove
59
+ if "torch" in sys.modules:
60
+ warnings.warn(
61
+ "`torch` was loaded before the juliacall. This may cause a segfault. "
62
+ "To avoid this, import `juliacall` *before* importing `torch`. "
63
+ "For updates, see https://github.com/pytorch/pytorch/issues/78829"
64
+ )
65
66
def option(name, default=None, xkey=None, envkey=None):
67
"""Get an option.
0 commit comments