Skip to content

Commit 346a2a9

Browse files
committed
Fix duplicated inputs bug in MarginalizedRV construction
1 parent 55331c5 commit 346a2a9

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

pymc_experimental/model/marginal_model.py

+1-1
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

-1
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,6 @@ def test_recover_batched_marginal():
373373
assert post.lp_idx.shape == (*post.idx.shape, 2)
374374

375375

376-
@pytest.mark.xfail(reason="Still need to investigate")
377376
def test_nested_recover_marginals():
378377
"""Test that marginalization works when there are nested marginalized RVs"""
379378

0 commit comments

Comments
 (0)