Open
Description
Description
In #7656 we allow PyTensor deterministic operations in the graph of observed variables, but we probably don't want to allow PyMC determinstics. Doing that makes model cloning failing, for starters:
import pymc as pm
with pm.Model() as m:
x_data = pm.Data("x_data", [0, 1, 2])
y_data = pm.Deterministic("y", x_data + 1)
y = pm.Normal("y", observed=y_data)
m.clone() # ValueError: Variable name y already exists.
I am not sure about the implications of mixing the two, I suggest we be conservative and don't allow it for now, unless a good reason crops up. Also a Deterministic like this would be wastefully saved in every iteration of pm.sample
!