Skip to content

Commit

Permalink
Fix pyspiel to python policy function when using deterministic policies.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 668891440
Change-Id: Ib2f8528c9f34c4045193e448f253cb9b3b188c8a
  • Loading branch information
lukemarris authored and lanctot committed Sep 23, 2024
1 parent 9435c48 commit d1bddb3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions open_spiel/python/policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,8 @@ def pyspiel_policy_to_python_policy(game, pyspiel_tabular_policy, players=None):
if players is not None and info_state_str not in policy.state_lookup:
continue
state_policy = policy.policy_for_key(info_state_str)
if actions_probs:
state_policy[:] = 0.0 # Ensure policy is zero by default.
for action, prob in actions_probs:
state_policy[action] = prob
return policy
Expand Down

0 comments on commit d1bddb3

Please sign in to comment.