Skip to content

Commit 09dd147

Browse files
committed
Fix duplicated inputs bug in MarginalizedRV construction
1 parent 20e8856 commit 09dd147

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

pymc_experimental/model/marginal_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ def replace_finite_discrete_marginal_subgraph(fgraph, rv_to_marginalize, all_rvs
683683
"This is currently not supported",
684684
)
685685

686-
input_rvs = [*marginalized_rv_input_rvs, *dependent_rvs_input_rvs]
686+
input_rvs = list(set((*marginalized_rv_input_rvs, *dependent_rvs_input_rvs)))
687687
rvs_to_marginalize = [rv_to_marginalize, *dependent_rvs]
688688

689689
outputs = rvs_to_marginalize

tests/model/test_marginal_model.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,6 @@ def test_batched(self):
754754
assert post.idx.shape == post.y.shape
755755
assert post.lp_idx.shape == (*post.idx.shape, 2)
756756

757-
@pytest.mark.xfail(reason="Still need to investigate")
758757
def test_nested(self):
759758
"""Test that marginalization works when there are nested marginalized RVs"""
760759

0 commit comments

Comments
 (0)