-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
BUG: Using a length-only coord causes it to be volatile #7376
Comments
|
The volatility logic is supposed to check if the values of mutable data actually changed (it's not enough to be mutable) so this is quite surprising |
Ah I think I understand what the issue is. The condition check for Lines 797 to 803 in 9eaf92a
But if you add a coord without any values (just the length) m.add_coord("coord0", length=1) then the coord, will be Lines 1030 to 1031 in 9eaf92a
I guess my question now: is this the intended? |
I see, we always always get tricked by coords without values (as in we tend to forget they exist all the time). In that case the volatility check should be whether the length changed or not? What do you think? And do you want to open a PR to fix it? |
For sure it threw me in for a loop. So I think it should either be considered constant if the length stays the same, or a log message should be fired. I've opened a PR #7381 and we can continue any discussion there |
Describe the issue:
When a variable is defined with a coord, it's considered volatile. Then
sample_posterior_predictive
does not transfer the node over.I believe the volatility condition that's met is
pymc/pymc/sampling/forward.py
Lines 208 to 212 in 9eaf92a
The coord is intended to be immutable, but after #7047, coords always mutable
Somewhat related:
sample_posterior_predictive
API less surprising #7069sample_posterior_predictive
does not consider changes in "ConstantData" and "Constant coords" #6876(lmk if this issue is considered a duplicate of anything)
Reproduceable code example:
Error message:
PyMC version information:
5.15.1
Context for the issue:
Cannot use
sample_posterior_predictive
as intendedThe text was updated successfully, but these errors were encountered: