From 2e6fca9d0a945cff2ff897026a194657563a540f Mon Sep 17 00:00:00 2001 From: Sotetsu KOYAMADA Date: Wed, 23 Oct 2024 12:29:54 +0900 Subject: [PATCH] . --- pgx/_src/games/chess.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pgx/_src/games/chess.py b/pgx/_src/games/chess.py index 50e92c37b..3fd8eb13e 100644 --- a/pgx/_src/games/chess.py +++ b/pgx/_src/games/chess.py @@ -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