pytensor
pytensor copied to clipboard
PyTensor allows you to define, optimize, and efficiently evaluate mathematical expressions involving multi-dimensional arrays.
This PR uses the more new experimental vectorized jacobian in the minimize/root Ops, with the goal of getting it more tested, as it won't be breaking any people's code. The...
### Description ```python from pytensor.graph import FunctionGraph import pytensor.scalar as ps from pytensor.link.c.basic import CLinker x = ps.float64("x") o = x + 1 cl = CLinker().accept(FunctionGraph([x], [o])) cl.cmodule_key() from pytensor.graph...
### Description ```python import pytensor import pytensor.tensor as pt from pytensor.compile.mode import Mode x0 = pt.scalar("x0") ys, _ = pytensor.scan( lambda ytm1: ytm1 ** 2, outputs_info=[x0], n_steps=4, mode=Mode(linker="py", optimizer="fast_run").excluding("fusion"), )...
### Description This comes up in statespace models. `BlockDiag` is variadic, so graphs like this can be canonicalized: ```py import pytensor.tensor as pt import pytensor a, b, c = pt.matrices('a',...
https://github.com/pymc-devs/pytensor/blob/82bb9642daa7514c07e233b3486bd75f85503d8c/pytensor/sparse/basic.py?plain=1#L2273
https://github.com/pymc-devs/pytensor/blob/82bb9642daa7514c07e233b3486bd75f85503d8c/pytensor/sparse/basic.py?plain=1#L2496
## 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) - [...
### Issue with current documentation: We are missing examples using MLX backend. ### Idea or request for content: _No response_
## Description Extend verify_grad to complex gradient following the holomorphic gradient convention (as in JAX). The decision on which convention to follow (JAX-like or torch-like) has not been taken yet;...
### Description Why would function be inside `types.py`? Better name suggestions? This is utmost priority!