pytensor
pytensor copied to clipboard
PyTensor allows you to define, optimize, and efficiently evaluate mathematical expressions involving multi-dimensional arrays.
### Describe the issue: When I execute `conda search pytensor` I received ``` Loading channels: done # Name Version Build Channel pytensor 2.12.3 py310h46d7db6_0 pkgs/main pytensor 2.12.3 py310h46d7db6_2 pkgs/main pytensor...
retstep=True returns a tuple which doesn't work with the astype https://github.com/pymc-devs/pytensor/blob/c822a8e626f8c4538e954f134fc4a509232bcf62/pytensor/tensor/extra_ops.py?plain=1#L1799-L1808 ``` [ins] In [1]: import pytensor.tensor as pt [ins] In [2]: pt.linspace(0, 1, retstep=True) --------------------------------------------------------------------------- AttributeError Traceback (most recent...
## 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) - [...
Small cleanup ---- 📚 Documentation preview 📚: https://pytensor--1300.org.readthedocs.build/en/1300/
### Description Make our codebase more leightweight by removing: * pytensor.tensor.basic.PermuteRowElements * pytensor.tensor.io.LoadFromDisk Replace by symbolic equivalent: * pytensor.tensor.extra_ops.Bartlett (can be implemented symbolic easily: https://github.com/numpy/numpy/blob/e7a123b2d3eca9897843791dd698c1803d9a39c2/numpy/lib/_function_base_impl.py#L3254-L3262) * pytensor.tensor.extra_ops.UnravelIndex (not sure how...
### Description If we have any empty operations, we can truncate the whole graph above it: ```python import pytensor import pytensor.tensor as pt x = pt.vector("x", shape=(10,)) out = pt.add.outer(x,...
### Description The local_subtensor_merge op often makes graph worse instead of better: https://github.com/pymc-devs/pytensor/blob/main/pytensor/tensor/rewriting/subtensor.py#L475 ```python import pytensor.tensor as pt import pytensor x = pt.dvector("x") y = x[1:-1][1:-1][1:-1] pytensor.config.optdb__max_use_ratio = 20 func...
### Description The gradient of x[1:][-1] has two successive inc_subtensor on zeros of increasing size. We should collapse them, as happens if you take the gradient of the single slice...
```python import pytensor import pytensor.tensor as pt from pytensor.compile.mode import get_default_mode n = pt.iscalar("n") x0 = pt.vector("x0") xs, _ = pytensor.scan(lambda xtm1: xtm1 + 1, outputs_info=[x0], n_steps=n) mode = get_default_mode().including("scan_save_mem")...
### Description ```python import pytensor import pytensor.tensor as pt from pytensor.compile.mode import get_default_mode n = pt.iscalar("n") x0 = pt.vector("x0") xs, _ = pytensor.scan(lambda xtm1: xtm1 + 1, outputs_info=[x0], n_steps=n) out...