diff options
Diffstat (limited to 'include/nn.c')
| -rw-r--r-- | include/nn.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/include/nn.c b/include/nn.c index 9b241a1..7a42a02 100644 --- a/include/nn.c +++ b/include/nn.c @@ -91,10 +91,12 @@ void nn_prepare_input(float *cur_board, tak_state_p state, const float embedding[NN_N_EMB]) { const unsigned int n_cells = state->board_size * state->board_size; nn_prepare_head(cur_board, state); - nn_cell_idxs(prepared_idxs, state); + for (unsigned int loc = 0; loc < n_cells; loc++) { + const uint8_t idx = cell_idx_at(state, loc); + prepared_idxs[loc] = idx; + cur_board[2 + loc] = embedding[idx]; + } prepared_hash = state->hash; - for (unsigned int loc = 0; loc < n_cells; loc++) - cur_board[2 + loc] = embedding[prepared_idxs[loc]]; } // Copy the cell indices produced by the most recent nn_prepare_input into out |
