-
Notifications
You must be signed in to change notification settings - Fork 112
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
local_add_neg_to_sub
rewrite gives wrong results with negative constants
#584
Comments
Fixes bug in `local_add_neg_to_sub` reported in pymc-devs#584
Fixes bug in `local_add_neg_to_sub` reported in pymc-devs#584
Fixes bug in `local_add_neg_to_sub` reported in pymc-devs#584
Fixes bug in `local_add_neg_to_sub` reported in pymc-devs#584
Fixes bug in `local_add_neg_to_sub` reported in pymc-devs#584
Fixes bug in `local_add_neg_to_sub` reported in pymc-devs#584
Fixes bug in `local_add_neg_to_sub` reported in pymc-devs#584
Fixes bug in `local_add_neg_to_sub` reported in pymc-devs#584
pytensor/pytensor/tensor/rewriting/math.py Lines 1918 to 1922 in c52154d
Do we actually want to keep this part? If it replaces |
Good point, it doesn't save us anything with a constant. Only reason would be for canonicalization but this is a specialization rewrite. Will remove that branch and see if anything was relying on it |
Fixes bug in `local_add_neg_to_sub` reported in pymc-devs#584
Fixes bug in `local_add_neg_to_sub` reported in pymc-devs#584
Reported in https://discourse.pymc.io/t/shape-issue-with-custom-logp-in-densitydist/13608/5?u=ricardov94
pytensor/pytensor/tensor/rewriting/math.py
Lines 1897 to 1922 in c52154d
The helper
get_constant
actually callsget_unique_constant_value
under the hood, which in this case returns a single scalar, not the filled homogenous vector. The rewrite itself is also expecting only a scalar constant, otherwise it should be usingnp.all
The text was updated successfully, but these errors were encountered: