Skip to content

Commit

Permalink
BP sample tests: fix seed
Browse files Browse the repository at this point in the history
  • Loading branch information
jcmgray committed Oct 20, 2023
1 parent 91c4266 commit 4b8d35f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/test_tensor/test_belief_propagation/test_hd1bp.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def test_contract_normal(damping):
def test_sample(damping):
nvars = 20
htn = qtn.HTN_random_ksat(3, nvars, alpha=2.0, seed=42, mode="dense")
config, tn_config, omega = sample_hd1bp(htn, damping=damping)
config, tn_config, omega = sample_hd1bp(htn, damping=damping, seed=42)
assert len(config) == nvars
assert tn_config.num_indices == 0
assert tn_config.contract() == pytest.approx(1.0)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_tensor/test_belief_propagation/test_hv1bp.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def test_contract_normal(damping):
def test_sample(damping):
nvars = 20
htn = qtn.HTN_random_ksat(3, nvars, alpha=2.0, seed=42, mode="dense")
config, tn_config, omega = sample_hv1bp(htn, damping=damping)
config, tn_config, omega = sample_hv1bp(htn, damping=damping, seed=42)
assert len(config) == nvars
assert tn_config.num_indices == 0
assert tn_config.contract() == pytest.approx(1.0)
Expand Down

0 comments on commit 4b8d35f

Please sign in to comment.