-
-
Notifications
You must be signed in to change notification settings - Fork 152
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
Add specialization for subtraction and addition with negative terms #549
Conversation
6e97aa6
to
391e2cf
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #549 +/- ##
=======================================
Coverage 74.09% 74.10%
=======================================
Files 174 174
Lines 48605 48622 +17
Branches 10340 10348 +8
=======================================
+ Hits 36014 36030 +16
Misses 10305 10305
- Partials 2286 2287 +1
|
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.
This looks really good! I have some comments/questions about the special DimShuffle
logic, but that's it.
I should take a look if somethings can be removed from here after this PR: aesara/aesara/tensor/math_opt.py Line 2686 in 391e2cf
There seems to be a lot of redundancy going on |
9e6b7e6
to
d0b208a
Compare
6142a8e
to
164578b
Compare
164578b
to
fa622f2
Compare
8344ff4
to
6d5b874
Compare
6d5b874
to
fe30770
Compare
aeaf64d
to
be0c437
Compare
be0c437
to
82f5721
Compare
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.
Looks like CI was stuck, so I rebased it.
82f5721
to
4b70c14
Compare
Rebased the branch on |
4b70c14
to
4da5a26
Compare
4da5a26
to
560e573
Compare
* Also reverses test expectation for `local_expm1` rewrite, as previously missed case is now detected
560e573
to
1846741
Compare
Adding these during canonicalization conflicted with a couple of other rewrites.
local_neg_to_mul
tries to convert-x -> -1. * x
, so that thelocal_mul_canonizer
can do its thing.local_add_canonizer
will try to place them on the left of the graph for "constant folding" and leave them as anadd
, even if they are negative. For examplex - 5 -> -5 + x
.The new rewrites were registered or designed not to conflict with these preexisting rewrites
Closes #546