forked from pymc-devs/pytensor
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
linalg.block_diag
and sparse equivalent (pymc-devs#576)
* Copy `block_diag` and support functions from `pymc.math` * Evaluate output in sphinx code example Co-authored-by: Ricardo Vieira <28983449+ricardoV94@users.noreply.github.com> * Test type equivalence with `isinstance` instead of `==` Co-authored-by: Ricardo Vieira <28983449+ricardoV94@users.noreply.github.com> * Typo in test function * Split `block_diag` into sparse and dense version Closely follow scipy function signature for `block_diag` * Use `as_sparse_or_tensor_variable` in `SparseBlockDiagonalMatrix` to allow sparse matrix inputs to `pytensor.sparse.block_diag` * Test sparse and dense inputs to `pytensor.sparse.block_diag` * Add numba overload for `pytensor.tensor.slinalg.block_diag` * add jax overload for `pytensor.tensor.slinalg.block_diag` * Move stand-alone `block_diag_grad` function into `grad` method * Add `format` prop to `SparseBlockDiagonalMatrix` * Use `compare_numba_and_py` in `numba\test_slinalg.py::test_block_diag` * Add support for Blockwise to `slinalg.block_diag` * Add gradient test Remove `Matrix` from `BlockDiagonal` and `SparseBlockDiagonal` `Op` names Correct errors in docstrings Move input validation to a shared class method * Remove `gufunc_signature` from `__props__` Co-authored-by: Ricardo Vieira <28983449+ricardoV94@users.noreply.github.com> * Implement correct `__props__` for subclasses of `BaseBlockMatrix` --------- Co-authored-by: Ricardo Vieira <28983449+ricardoV94@users.noreply.github.com>
- Loading branch information
1 parent
96f753b
commit c4ae6e3
Showing
9 changed files
with
348 additions
and
13 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
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
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
Oops, something went wrong.