-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Fix setting initvals on ZeroSumTransform rv #7773
New issue
Have a question about this project? No Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “No 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? No Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Is a new test required for this? I can easily add the one in the issue, but it seems a bit of an overkill, considering it will sample a model. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7773 +/- ##
=======================================
Coverage 92.83% 92.84%
=======================================
Files 107 107
Lines 18354 18378 +24
=======================================
+ Hits 17039 17063 +24
Misses 1315 1315
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a staticmethod, so a unit test could test just that.
The extend_axis_rev
below it has the same bug.
Fixed the one below and added a few basic tests. Turns out, this transform was only tested through ZeroSumNormal before, so had to add a new segment for it in transforms |
@@ -312,7 +312,7 @@ def extend_axis(array, axis): | |||
def extend_axis_rev(array, axis): | |||
normalized_axis = normalize_axis_tuple(axis, array.ndim)[0] | |||
|
|||
n = array.shape[normalized_axis].astype("floatX") | |||
n = pt.cast(array.shape[normalized_axis], "floatX") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead you can call pt.as_tensor(array)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering, is it better than pt.cast for some reason?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really, I was just thinking out loud
One test is failing now due to precision issues? |
Description
Fix setting initvals on ZeroSumTransform'ed rv
Related Issue
Checklist
Type of change
📚 Documentation preview 📚: https://pymc--7773.org.readthedocs.build/en/7773/