-
Notifications
You must be signed in to change notification settings - Fork 114
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 Cholesky and SolveTriangular for torch #1035
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1035 +/- ##
==========================================
+ Coverage 81.74% 81.89% +0.15%
==========================================
Files 183 183
Lines 47724 47897 +173
Branches 11616 8617 -2999
==========================================
+ Hits 39011 39225 +214
+ Misses 6520 6499 -21
+ Partials 2193 2173 -20
|
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.
Title should mention SolveTriangular as well
torch = pytest.importorskip("torch") | ||
|
||
|
||
# @todo: We don't have blockwise yet for torch |
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 is a specific test, just test cholesky and solve directly with the compare_py_and_torch
as usual
|
||
def solve_triangular(A, b): | ||
return torch.linalg.solve_triangular( | ||
A, b, upper=not lower, unit_triangle=unit_diagonal, left=trans == "T" |
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.
trans may also be 1
apparently. We should canonicalize the integers to strings so the Op only has to handle one of the encodings: https://docs.scipy.org/doc/scipy/reference/generated/scipy.linalg.solve_triangular.html
Actually these Ops were already being tackled in #922 |
Ah yup - want me to close this then? |
Gonna close this while #922 is open - can always reopen it. |
Description
Add torch cholesky operator
Related Issue
Checklist
Type of change
📚 Documentation preview 📚: https://pytensor--1035.org.readthedocs.build/en/1035/