pymc-devs / pymc

Bayesian Modeling and Probabilistic Programming in Python
https://docs.pymc.io/
Other
8.47k stars 1.97k forks source link

Fix bug when freezing model with partially observed RVs #7388

Closed ricardoV94 closed 6 days ago

ricardoV94 commented 6 days ago

Description

The problem was that the constant_fold call in create_partially_observed_rv was cloning the shared variable that defined the dim_length, and therefore it could no longer be replaced by it in freeze_data_and_dims

Related Issue

Checklist

Type of change


πŸ“š Documentation preview πŸ“š: https://pymc--7388.org.readthedocs.build/en/7388/

codecov[bot] commented 6 days ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 92.19%. Comparing base (7af0a87) to head (e2f86cb).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/pymc-devs/pymc/pull/7388/graphs/tree.svg?width=650&height=150&src=pr&token=JFuXtOJ4Cb&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pymc-devs)](https://app.codecov.io/gh/pymc-devs/pymc/pull/7388?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pymc-devs) ```diff @@ Coverage Diff @@ ## main #7388 +/- ## ======================================= Coverage 92.19% 92.19% ======================================= Files 103 103 Lines 17214 17214 ======================================= Hits 15870 15870 Misses 1344 1344 ``` | [Files](https://app.codecov.io/gh/pymc-devs/pymc/pull/7388?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pymc-devs) | Coverage Ξ” | | |---|---|---| | [pymc/pytensorf.py](https://app.codecov.io/gh/pymc-devs/pymc/pull/7388?src=pr&el=tree&filepath=pymc%2Fpytensorf.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pymc-devs#diff-cHltYy9weXRlbnNvcmYucHk=) | `90.44% <100.00%> (ΓΈ)` | |