Skip to content

Accessing unobserved_value_vars changes model in place #7054

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ricardoV94 opened this issue Dec 8, 2023 · 0 comments · Fixed by #7055
Closed

Accessing unobserved_value_vars changes model in place #7054

ricardoV94 opened this issue Dec 8, 2023 · 0 comments · Fixed by #7055
Labels

Comments

@ricardoV94
Copy link
Member

ricardoV94 commented Dec 8, 2023

Description

Reported in https://discourse.pymc.io/t/missinginputerror-when-sampling-data/13426

import pytensor
import pymc as pm

with pm.Model() as m:
    theta1 = pm.Normal("theta1", 0, 1)
    theta2 = pm.Uniform("theta2", -theta1, theta1)

pytensor.dprint(theta2)
m.unobserved_value_vars
pytensor.dprint(theta2)  # Now includes the value var of theta1 in the graph!

theta2.eval()  # MissingInputError

Caused by the recent refactor in #6976
One of the replace functions that is now used causes an inplace change that was not caused by the previous one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant