pytensor
pytensor copied to clipboard
PyTensor allows you to define, optimize, and efficiently evaluate mathematical expressions involving multi-dimensional arrays.
### Description ```python import pytensor.tensor as pt import numpy as np x = np.zeros(3) x[[0, 0, 0]] += 1 print(x) # [1, 0, 0] x = pt.zeros(3) x = x[[0,...
## Description Adds the following rewrites : - diag(kron(a,b)) -> outer(diag(a), diag(b)) - slogdet(kron(a,b)) -> prod(sign(a), sign(b)), sum(logdet(a), logdet(b)) ## Related Issue - [ ] Related to #573 ## Checklist...
## 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 - [ ]...
## Description Make DimShuffle less concerned about it's input static broadcastable type when dropping dims, since no behavior depends on it being specified at runtime. But there is no reason...
### Description If you want to help implementing some of these Ops just leave a comment below saying which ones you are interested in. We'll give you some time to...
https://github.com/pymc-devs/pytensor/blob/236a3dfec7cc69217e9504b43aa1ed88213ec5be/tests/link/numba/test_cython_support.py#L95-L97 Started failing in https://github.com/pymc-devs/pytensor/actions/runs/10537278556/job/29198505441?pr=979#step:6:1606 ```python ValueError: Invalid signature: double (Py_ssize_t, double, int __pyx_skip_dispatch) ``` CC @aseyboldt does it look like an easy fix?
### Description Reported in https://discourse.pymc.io/t/cannot-drop-a-non-broadcastable-dimension-and-rfft/14920 ```python import pytensor.tensor as pt from pytensor.tensor import fft p = pt.vector("p", shape=(4,)) out = fft.rfft(p[None, :]) pt.grad(out.sum(), p) # Cannot drop a non-broadcastable dimension:...
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5. Release notes Sourced from actions/setup-python's releases. v5.0.0 What's Changed In scope of this release, we update node version runtime from node16 to node20 (actions/setup-python#772)....
### Description Right now we have a function `pt.nlinalg.matrix_dot` that is just a helper for doing repeated dot products. This is similar to but worse than `np.linalg.multi_dot`, because `multi_dot` also...
### Description One might be `indexing.py` or `index_tricks.py`. That could hold anything related to generating indices or masks (including the new `_delta` and `_iota` functions introduced in #722. There could...