From 74492d5d91bf12894d87d20a8c481b45e963364a Mon Sep 17 00:00:00 2001 From: Siddharth Goyal Date: Fri, 9 Feb 2018 18:16:45 -0800 Subject: [PATCH] Add proper casts for avoiding warnings (#8346) --- paddle/inference/tests/book/test_helper.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/paddle/inference/tests/book/test_helper.h b/paddle/inference/tests/book/test_helper.h index 02104306e71..9774f3fbcb4 100644 --- a/paddle/inference/tests/book/test_helper.h +++ b/paddle/inference/tests/book/test_helper.h @@ -34,7 +34,7 @@ template void SetupTensor(paddle::framework::LoDTensor& input, paddle::framework::DDim dims, std::vector& data) { - CHECK_EQ(paddle::framework::product(dims), data.size()); + CHECK_EQ(paddle::framework::product(dims), static_cast(data.size())); T* input_ptr = input.mutable_data(dims, paddle::platform::CPUPlace()); memcpy(input_ptr, data.data(), input.numel() * sizeof(T)); } @@ -55,7 +55,7 @@ void SetupLoDTensor(paddle::framework::LoDTensor& input, paddle::framework::LoD lod, std::vector& data) { const size_t level = lod.size() - 1; - CHECK_EQ(dims[0], (lod[level]).back()); + CHECK_EQ(dims[0], static_cast((lod[level]).back())); input.set_lod(lod); SetupTensor(input, dims, data); } @@ -84,7 +84,7 @@ void CheckError(paddle::framework::LoDTensor& output1, count++; } } - EXPECT_EQ(count, 0) << "There are " << count << " different elements."; + EXPECT_EQ(count, 0U) << "There are " << count << " different elements."; } template -- GitLab