pytensor
pytensor copied to clipboard
Added rewrites involving block diagonal matrices
Description
Added the following rewrites :
- diag(block_diag(*sub_matrices)) -> concatenate(diag(sub_matrices))
- det(block_diag(*sub_matrices)) -> prod(det(sub_matrices))
- slogdet(block_diag(*sub_matrices)) -> prod(sign(a), sign(b), sign(c),...), sum(logdet(a), logdet(b), logdet(c),....)
Related Issue
- [ ] Related to #573
Checklist
- [ ] Checked that the pre-commit linting/style checks pass
- [ ] Included tests that prove the fix is effective or that the new feature works
- [ ] Added necessary documentation (docstrings and/or example notebooks)
- [ ] If you are a pro: each commit corresponds to a relevant logical change
Type of change
- [ ] New feature / enhancement
- [ ] Bug fix
- [ ] Documentation
- [ ] Maintenance
- [ ] Other (please specify):
You need to rebase.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 81.74%. Comparing base (
1a1c62b) to head (fa7d9da). Report is 133 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #967 +/- ##
==========================================
+ Coverage 81.73% 81.74% +0.01%
==========================================
Files 182 182
Lines 47633 47663 +30
Branches 11604 11622 +18
==========================================
+ Hits 38934 38964 +30
+ Misses 6509 6507 -2
- Partials 2190 2192 +2
| Files with missing lines | Coverage Δ | |
|---|---|---|
| pytensor/tensor/rewriting/linalg.py | 92.48% <100.00%> (+0.81%) |
:arrow_up: |