Handle lower
flag more carefully in Solve to CholeskySolve rewrite
#1492
+50
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
There was some discussion in #1467 about whether the
reuse_decomposition_multiple_solves
rewrite was doing the right thing with thelower
flags, especially in the corner case where a user is being really clever and only storing half the symmetric matrix.This PR handles the case more carefully, and checks on a matrix with NaN values that we don't look at the wrong triangles after rewriting.
It also forwards the
check_finite
argument in theCholesky
Op, which was not being respected previously. I think this is also being fixed in #1487 , so there's some undesirable overlap between these PRs.Related Issue
cholesky
decomposition withcho_solve
in graphs with multiplept.solve
whenassume_a = "pos"
#1467Checklist
Type of change
📚 Documentation preview 📚: https://pytensor--1492.org.readthedocs.build/en/1492/