pytensor
pytensor copied to clipboard
PyTensor allows you to define, optimize, and efficiently evaluate mathematical expressions involving multi-dimensional arrays.
### Description ```python import pytensor import pytensor.tensor as pt x0 = pt.vector("x0") n = pt.iscalar("n") outs, _ = pytensor.scan(lambda xtm1: (xtm1 + 1, xtm1), outputs_info=[x0, None], n_steps=n) fn = pytensor.function([n,...
### Description This is full of obscure stuff: ```python ```python import pytensor dir(pytensor) ['Any', 'FunctionMaker', 'In', 'Lop', 'Mode', 'NoReturn', 'OpFromGraph', 'Optional', 'OrderedUpdates', 'Out', 'Path', 'ProfileStats', 'Rop', 'Variable', '__annotations__', '__api_version__', '__builtins__',...
This allows reducing computations on batch dimensions by lifting simple indexing operations closer to the inputs. An obvious example is: ```python import numpy as np import pytensor import pytensor.tensor as...
### Description Follow up to #1281 In the numba backend we allow inplacing of the inner sit-sot / oldest mit-sot when we know the buffer is only large enough to...
### Description Follow up to #1281 where we allow inplacing of sit-sot/mit-sot in some cases. I think inplacing of mit-mot is always valid as per the Scan python-c implementation but...
### Description Currently we have an Op that calls `np.tri`, but we can very easily build lower triangular mask matrices with `_iota`: ```py from pytensor.tensor.einsum import _iota def tri(M, N,...
### Description Reference: https://github.com/conda-forge/mkl-service-feedstock/pull/38 Context: MKL dropped OSX support from the 2024.0 release. In the `pytensor` conda-forge package, we depend on the [mkl-service package](https://github.com/IntelPython/mkl-service) for BLAS with Windows and non-ARM...
### Description `C` would be equivalent to the current `FAST_RUN`. In the future we may want to change `FAST_RUN` to be the current `NUMBA` `Python` would be new, something with...
Fixes https://github.com/pymc-devs/pytensor/issues/1245\n\nSummary:\n- When a RandomVariable is not implemented in Numba, it now gracefully falls back to object mode.\n- Added tests to verify that unsupported RandomVariables correctly trigger the object mode...
## Description - Optimized local_blockwise_dot_to_mul to handle (1,1) @ (1,1) cases as direct elementwise multiplication. - Prevents unnecessary reshaping for scalar-like tensors. - Ensures consistency with other elementwise multiplication cases....