Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
sotetsuk committed Oct 23, 2024
1 parent 7664989 commit 2e6fca9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pgx/_src/games/chess.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ def legal_labels(label):
a1 = jax.vmap(legal_normal_moves)(possible_piece_positions).flatten()
a2 = legal_en_passants()
actions = jnp.hstack((a1, a2)) # include -1
ixs = jnp.nonzero(actions >= 0, size=16 * 19, fill_value=0)[0] # 16 * 27 = 432 -> 16 * 19 = 304
ixs = jnp.nonzero(actions >= 0, size=128, fill_value=0)[0] # 128: random large number
actions = actions[ixs]
actions = jnp.where(jax.vmap(is_not_checked)(actions), actions, -1)
mask = jnp.zeros(64 * 73 + 1, dtype=jnp.bool_) # +1 for sentinel
Expand Down

0 comments on commit 2e6fca9

Please sign in to comment.