Skip to content

Commit 94b0c2e

Browse files
Hotfix theano.printing upon import
A workaround for pymc-devs/pytensor#309
1 parent 25e9476 commit 94b0c2e

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

pymc3/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,22 @@ def __set_compiler_flags():
6262
theano.config.gcc__cxxflags = f"{current} -Wno-c++11-narrowing"
6363

6464

65+
def _hotfix_theano_printing():
66+
""" This is a workaround for https://github.com/pymc-devs/aesara/issues/309 """
67+
try:
68+
import pydot
69+
import theano.printing
70+
71+
if theano.printing.Node != pydot.Node:
72+
theano.printing.Node = pydot.Node
73+
except ImportError:
74+
# pydot is not installed
75+
pass
76+
77+
6578
_check_backend_version()
6679
__set_compiler_flags()
80+
_hotfix_theano_printing()
6781

6882
from pymc3 import gp, ode, sampling
6983
from pymc3.backends import load_trace, save_trace

0 commit comments

Comments
 (0)