-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rewrite determinant of diagonal matrix as product of diagonal (#797)
* Added det-diag rewrite * fixed pt.diagonal error * Added test for rewrite * Added test for rewrite * fixed test * added check for verifying rewrite * fixed other failing test * added docstring * updated docstring * fixed mypy error * added det_diag_from_diag and test * fixed node rewriter name * added row/col tests * updated check for eye * updated rewrite and tests * added check for eye_input and new test for cases where not to apply rewrite * does not apply rewrite to specific cases * typecasted test variable * typecast variables * removed shape known check; fails for rectangle eye * added new tests for (1,1) eye and rectangle eye * added helper function for diag from eye_mul * updated case for no rewrite which was failing tests * cleaned code; updated rectangle_eye test which is an invalid rewrite * add check for k in pt.eye * Update pytensor/tensor/rewriting/linalg.py Co-authored-by: Ricardo Vieira <28983449+ricardoV94@users.noreply.github.com> * typecasted det_val * fixed final typecasting * fixed merge * fixed failing rectangle eye test * fixed typo --------- Co-authored-by: Ricardo Vieira <28983449+ricardoV94@users.noreply.github.com>
- Loading branch information
1 parent
bf8a1b5
commit 94e9ef0
Showing
2 changed files
with
192 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters