Registry / ai-ml / pytensor-distributions

pytensor-distributions

JSON →
library0.2.0pypypiunverified

PyTensor-powered probability distributions for probabilistic programming and Bayesian inference. Version 0.1.3, released 2025, maintenance level with monthly patches.

pip install pytensor-distributions
INSTALL
IMPORT
SIG · PYTENSOR-DISTRIBUT
P
pytensor-distributions
ai-mlpythonv0.2.0
Install
12.6s avg
Import
Disk
446MB
Pass rate
3/ 10
Env Coverage3 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.1.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✕ build_error
✕ build_error
py 3.11
✕ build_error
✓ 12s
py 3.12
✕ build_error
✓ 12.7s
py 3.13
✕ build_error
✓ 13s
py 3.9
✕ build_error
✕ build_error
446MB installed
● package 446MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Normal
from pytensor_distributions import Normal
from pytensor_distributions.distributions import Normal

Define a Normal distribution and compute log-probability.

import pytensor import pytensor.tensor as pt from pytensor_distributions.distributions import Normal x = pt.dmatrix('x') mu = pt.dvector('mu') sigma = pt.dscalar('sigma') dist = Normal.dist(mu, sigma) logp = dist.log_prob(x) # Evaluate f = pytensor.function([x, mu, sigma], logp) print(f([[1.0, 2.0], [3.0, 4.0]], [0.0, 1.0], 0.5))
Debug
Known issues
breakingThe distribution constructors use `.dist()` class method instead of direct instantiation (e.g., `Normal.dist(mu, sigma)` not `Normal(mu, sigma)`). Direct instantiation raises a TypeError.
fix
Always call `.dist()` on distribution classes to create distribution instances.
affects: all
gotchaRandom sampling is not supported yet. Calling `dist.sample()` raises NotImplementedError. Samples must be drawn using external sampling methods (e.g., MCMC via PyMC).
fix
Use PyMC or other sampling libraries; do not rely on pytensor-distributions for random draws.
affects: <=0.1.3
deprecatedSupport for Python 3.10 and below is dropped. Requires Python >=3.11.
fix
Upgrade to Python 3.11 or later.
affects: 0.1.0+
Upgrade
Version history
0.2.0latest on PyPI · released Jun 8, 2026
Audit
Dependencies
pytensorrequiredCore computation engine for tensor operations and automatic differentiation.
scipyrequiredProvides numerical constants and special functions used in distribution implementations.
Agent activity
20 hits · last 30 days
node
16
OpenAI (training)
1
Resources
pytensor-distributions — pip install pytensor-distributions · libregistry