Skip to content

Graphviz changes variables in place #6783

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 Jun 16, 2023 · 3 comments
Closed

Graphviz changes variables in place #6783

ricardoV94 opened this issue Jun 16, 2023 · 3 comments
Labels

Comments

@ricardoV94
Copy link
Member

Description

import pymc as pm

with pm.Model(coords_mutable={'i': [0]}) as m:
    beta_z = pm.ConstantData("beta_z", 0)
    beta_y = pm.ConstantData("beta_y", 0)
    z = pm.Bernoulli("z", p=pm.invlogit(beta_z), dims="i")
    y = pm.Normal("y", mu=beta_y + z, dims="i")

assert m["beta_y"].name == "beta_y"
assert m["beta_z"].name == "beta_z"
    
pm.model_to_graphviz(m)

assert m["beta_y"].name == "beta_y"
assert m["beta_z"].name == "beta_z"  # raises

Thin only happens with mutable coords, I imagine during evaluation.

@ricardoV94 ricardoV94 added the bug label Jun 16, 2023
@ricardoV94
Copy link
Member Author

Actually this is a PyTensor issue: pymc-devs/pytensor#347

@ricardoV94
Copy link
Member Author

ricardoV94 commented Jun 16, 2023

Although possibly, model_graph could used the name in model.named_vars instead of the PyTensor variable name

@ricardoV94
Copy link
Member Author

AFAICT there is no requirement in PyTensor for this behavior. Should be fixed by pymc-devs/pytensor#348

@ricardoV94 ricardoV94 closed this as not planned Won't fix, can't repro, duplicate, stale Jun 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant