We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5b6c804 commit 7e9e459Copy full SHA for 7e9e459
pymc/pytensorf.py
@@ -92,6 +92,23 @@
92
]
93
94
95
+# Temporarily add an Aesara dispatch for PyTensor TensorVariable to inform users
96
+# of incorrect mixing of libraries
97
+try:
98
+ from aesara.tensor import _as_tensor_variable as _as_tensor_variable_aesara
99
+
100
+ @_as_tensor_variable_aesara.register(TensorVariable)
101
+ def raise_informative_error(*args, **kwargs):
102
+ raise TypeError(
103
+ "You are calling an Aesara function with PyTensor variables.\n"
104
+ "Starting with PyMC 5.0, Aesara was replaced by PyTensor (see https://www.pymc.io/blog/pytensor_announcement.html).\n"
105
+ "Replace your import of aesara.tensor with pytensor.tensor.",
106
+ )
107
108
+except ImportError:
109
+ pass
110
111
112
def convert_observed_data(data):
113
"""Convert user provided dataset to accepted formats."""
114
0 commit comments