Skip to content
This repository was archived by the owner on Nov 17, 2025. It is now read-only.

Commit 9e822a1

Browse files
Add an xfail for a currently unsupported log-probability derivation
1 parent f987138 commit 9e822a1

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tests/test_transforms.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -763,3 +763,26 @@ def test_transform_measurable_sub():
763763

764764
with pytest.raises(DensityNotFound):
765765
joint_logprob(Z_rv, X_rv)
766+
767+
768+
@pytest.mark.xfail(
769+
reason="Reuse of measurable variables not supported", raises=DensityNotFound
770+
)
771+
def test_transform_reused_measurable():
772+
773+
srng = at.random.RandomStream(0)
774+
775+
X_rv = srng.normal(0, 1, name="X")
776+
Z_tr = at.exp(X_rv)
777+
778+
z_vv = at.dscalar(name="z_vv")
779+
780+
logprob, vvs = joint_logprob(realized={Z_tr: z_vv, X_rv: z_vv})
781+
782+
logp_fn = aesara.function([z_vv], logprob)
783+
784+
z_val = 0.1
785+
786+
exp_res = sp.stats.lognorm(s=1).logpdf(z_val) + sp.stats.norm().logpdf(z_val)
787+
788+
np.testing.assert_allclose(logp_fn(z_val), exp_res)

0 commit comments

Comments
 (0)