Fix comparison of integers with different signedness.

This commit is contained in:
Tomasz Sobczyk
2020-11-29 17:31:57 +01:00
committed by nodchip
parent a97b65eaef
commit 2aa7f5290e
5 changed files with 7 additions and 7 deletions

View File

@@ -214,7 +214,7 @@ namespace Eval::NNUE {
std::vector<double> gradient_norm_local(thread_pool.size(), 0.0);
auto prev_batch_begin = examples.end();
while (prev_batch_begin - examples.begin() >= batch_size) {
while ((long)(prev_batch_begin - examples.begin()) >= (long)batch_size) {
auto batch_begin = prev_batch_begin - batch_size;
auto batch_end = prev_batch_begin;
auto size = batch_end - batch_begin;

View File

@@ -95,7 +95,7 @@ namespace Eval::NNUE {
{
const auto size = batch_end - batch_begin;
if (output_.size() < kOutputDimensions * size) {
if ((long)output_.size() < (long)kOutputDimensions * size) {
output_.resize(kOutputDimensions * size);
gradients_.resize(kInputDimensions * size);
}

View File

@@ -46,7 +46,7 @@ namespace Eval::NNUE {
{
const auto size = batch_end - batch_begin;
if (output_.size() < kOutputDimensions * size) {
if ((long)output_.size() < (long)kOutputDimensions * size) {
output_.resize(kOutputDimensions * size);
gradients_.resize(kInputDimensions * size);
}

View File

@@ -93,7 +93,7 @@ namespace Eval::NNUE {
{
const auto size = batch_end - batch_begin;
if (output_.size() < kOutputDimensions * size) {
if ((long)output_.size() < (long)kOutputDimensions * size) {
output_.resize(kOutputDimensions * size);
gradients_.resize(kOutputDimensions * size);
}

View File

@@ -66,8 +66,8 @@ namespace Eval::NNUE {
const LearnFloatType* step_start(ThreadPool& thread_pool, std::vector<Example>::const_iterator batch_begin, std::vector<Example>::const_iterator batch_end)
{
const auto size = batch_end - batch_begin;
if (gradients_.size() < kInputDimensions * size) {
if ((long)gradients_.size() < (long)kInputDimensions * size) {
gradients_.resize(kInputDimensions * size);
}
@@ -244,7 +244,7 @@ namespace Eval::NNUE {
{
const auto size = batch_end - batch_begin;
if (output_.size() < kOutputDimensions * size) {
if ((long)output_.size() < (long)kOutputDimensions * size) {
output_.resize(kOutputDimensions * size);
gradients_.resize(kInputDimensions * size);
}