mirror of
https://github.com/official-stockfish/Stockfish.git
synced 2026-07-22 12:47:08 +00:00
Replacing nested loops with a single range-based for loop
closes https://github.com/official-stockfish/Stockfish/pull/6503 No functional change
This commit is contained in:
committed by
Joost VandeVondele
parent
593eeaf24c
commit
5b9259e51f
@@ -145,15 +145,10 @@ class FeatureTransformer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline void scale_weights(bool read) {
|
inline void scale_weights(bool read) {
|
||||||
for (IndexType j = 0; j < InputDimensions; ++j)
|
for (auto& w : weights)
|
||||||
{
|
w = read ? w * 2 : w / 2;
|
||||||
WeightType* w = &weights[j * HalfDimensions];
|
for (auto& b : biases)
|
||||||
for (IndexType i = 0; i < HalfDimensions; ++i)
|
b = read ? b * 2 : b / 2;
|
||||||
w[i] = read ? w[i] * 2 : w[i] / 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (IndexType i = 0; i < HalfDimensions; ++i)
|
|
||||||
biases[i] = read ? biases[i] * 2 : biases[i] / 2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read network parameters
|
// Read network parameters
|
||||||
|
|||||||
Reference in New Issue
Block a user