Skip to content

Commit

Permalink
Fix sampling bug
Browse files Browse the repository at this point in the history
  • Loading branch information
wesselb committed Aug 28, 2021
1 parent 2bb0321 commit 531dedd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion matrix/ops/sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ def sample(state: B.RandomState, a, num: B.Int = 1):

@B.dispatch
def sample(a, num: B.Int = 1):
return sample(B.global_random_state(a), a, num=num)[1]
state, res = sample(B.global_random_state(a), a, num=num)
B.set_global_random_state(state)
return res


@B.dispatch
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
requirements = [
"numpy>=1.16",
"plum-dispatch>=1.5.3",
"backends>=1.4.1",
"backends>=1.4.3",
"wbml>=0.3",
"algebra",
]
Expand Down

0 comments on commit 531dedd

Please sign in to comment.