pytensor
pytensor copied to clipboard
PyTensor allows you to define, optimize, and efficiently evaluate mathematical expressions involving multi-dimensional arrays.
## Description ## Related Issue - [ ] Closes # - [ ] Related to # ## Checklist - [ ] Checked that [the pre-commit linting/style checks pass](https://docs.pymc.io/en/latest/contributing/python_style.html) - [...
When working on Scan I kept wondering what was the deal with mit-mot and autodiff, so I tried to write up something that makes it more intuitive. I purposely don't...
We had support for boxing/unboxing Sparse objects in numba, but we couldn't do anything with them. This PR implements the basic functionality: 1. CSMProperties (Op that retrieves the attributes from...
### Description Scan always uses mit-mot for reverse-mode autodiff. This is the most general approach as it allows arbitrary connection pattern between intermediate states and the function cost. However, many...
## Description Reorganize the existing sparse code to be a bit more logical. In particular, the sparse module now mirrors the tensor module: - `sparse/basic.py` has constructors and utilities -...
## Description This is a draft PR for issue #1593. I’m setting up the local environment and exploring how to implement a rewrite that fuses nested BlockDiag Ops into a...
### Description The title sucks, but the case I'm interested in is a graph like this: ``` import pytensor.sparse as pts import pytensor.tensor as pt x = pts.csr_dmatrix() out =...
### Description I compared some variants of numba scan in https://gist.github.com/ricardoV94/1f579574570e347b4422470d9cad114f It suggests we can get meaningful speedups in the case where we only keep the last states, by avoiding...
### Description A simple example: ```py import pytensor.tensor as pt import pytensor x = pt.dmatrix('x') out = pt.linalg.det(pt.linalg.cholesky(x)) fn = pytensor.function([x], out) fn.dprint() Det [id A] 1 └─ Cholesky{lower=True, check_finite=False,...
### Description This came up in the context of #1674. We should consider reverting https://github.com/aesara-devs/aesara/issues/142. Sparse matrices and dense tensor are conceptually different enough that it doesn't make sense for...