Skip to content
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

with_data doesn't recognize shared variables when the compiled model has a name #136

Open
a2435191 opened this issue Jul 10, 2024 · 0 comments

Comments

@a2435191
Copy link

I figured out that you have to prefix the model name followed by two colons when updating variables in the with_data keyword arguments. I don't know if this is intended, but I thought I would raise this issue so that other people can search for it.

import pymc as pm
import nutpie

with pm.Model("a good name") as my_model:
    n = pm.Data("n", 1)
    pm.Binomial("my_var", n=n, p=0.7, observed=n.eval()/2)

compiled = nutpie.compile_pymc_model(model)
compiled.with_data(updates={'a good name::n', 15}) # works
compiled.with_data(n=15) # throws KeyError: 'Unknown shared variable: updates'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant