Skip to content

Commit fc889c7

Browse files
authored
fix a typo and a wrong type hint (official-stockfish#360)
1 parent b3becd3 commit fc889c7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ftperm.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ class SwapResult:
209209
score_change: float
210210

211211

212-
SwapFucntion: TypeAlias = Callable[[npt.NDArray[np.bool_], bool], SwapResult]
212+
SwapFunction: TypeAlias = Callable[[npt.NDArray[np.bool_], bool], SwapResult]
213213

214214

215215
def make_swaps_2(actmat: npt.NDArray[np.bool_], use_cupy: bool = True) -> SwapResult:
@@ -229,7 +229,7 @@ def make_swaps_2(actmat: npt.NDArray[np.bool_], use_cupy: bool = True) -> SwapRe
229229
# Sum score_change[i, j] + score_change[j, i] to get the cumulative impact of the swap.
230230
score_change = score_change + score_change.T
231231

232-
def all_indices_in_same_block(i: int) -> list[int]:
232+
def all_indices_in_same_block(i: np.int_) -> list[int]:
233233
"""Returns a list of indices of all neurons in the same block as the i-th neuron."""
234234
# Floor to the start of the block.
235235
base = i // ZERO_BLOCK_SIZE * ZERO_BLOCK_SIZE
@@ -373,7 +373,7 @@ def find_perm_impl(
373373
total_score_change = 0
374374
perm = np.arange(L1 // 2)
375375

376-
stages: list[SwapFucntion] = [make_swaps_2, make_swaps_3]
376+
stages: list[SwapFunction] = [make_swaps_2, make_swaps_3]
377377
# The optimization routines are deterministic, so no need to retry.
378378
stages_max_fails = [0, 0]
379379
stage_id = 0

0 commit comments

Comments
 (0)