Skip to content

Commit b537645

Browse files
committed
Explicitly declare batch iterators as const_iterator to fix GCC/Mingw64 compilation error
1 parent f442da2 commit b537645

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

include/neuralnetwork/neuralnetwork.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -788,8 +788,8 @@ void NeuralNetwork::train(const std::vector<std::vector<double>>& training_input
788788
for (size_t i = 0; i < total_sequences; i += batch_size)
789789
{
790790
const size_t current_batch_size = std::min(static_cast<size_t>(batch_size), total_sequences - i);
791-
auto inputs_it = bptt_in.begin() + i;
792-
auto outputs_it = bptt_out.begin() + i;
791+
std::vector<std::vector<double>>::const_iterator inputs_it = bptt_in.cbegin() + i;
792+
std::vector<std::vector<double>>::const_iterator outputs_it = bptt_out.cbegin() + i;
793793
_layers.train(_options, _learning_rate, inputs_it, outputs_it, current_batch_size);
794794
}
795795
}

0 commit comments

Comments
 (0)