Skip to content

Commit e47f418

Browse files
committed
fix some compiler warning
1 parent b854d95 commit e47f418

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed

paddle/fluid/framework/ir/attention_lstm_fuse_pass.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ std::unique_ptr<ir::Graph> AttentionLSTMFusePass::ApplyImpl(
262262
std::unordered_set<std::string> specified_vars({"data_lod_attention",
263263
"cell_init", "hidden_init",
264264
"data", "week", "minute"});
265-
int count = 0;
265+
size_t count = 0;
266266
for (auto* node : graph->Nodes()) {
267267
if (node->IsVar() && specified_vars.count(node->Name())) {
268268
++count;

paddle/fluid/framework/program_desc.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ const std::vector<std::string> ProgramDesc::GetFeedTargetNames() {
126126
std::vector<std::string> feed_target_names;
127127
for (auto *op : global_block.AllOps()) {
128128
if (op->Type() == kFeedOpType) {
129-
int col = boost::get<int>(op->GetAttr("col"));
129+
size_t col = boost::get<int>(op->GetAttr("col"));
130130
if (col >= feed_target_names.size()) {
131131
feed_target_names.resize(col + 1);
132132
}
@@ -143,7 +143,7 @@ const std::vector<std::string> ProgramDesc::GetFetchTargetNames() {
143143
std::vector<std::string> fetch_target_names;
144144
for (auto *op : global_block.AllOps()) {
145145
if (op->Type() == kFetchOpType) {
146-
int col = boost::get<int>(op->GetAttr("col"));
146+
size_t col = boost::get<int>(op->GetAttr("col"));
147147
if (col >= fetch_target_names.size()) {
148148
fetch_target_names.resize(col + 1);
149149
}

paddle/fluid/framework/reader_test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ TEST(READER, decorate_chain) {
3939
{
4040
auto endpoints = root->GetEndPoints();
4141
ASSERT_EQ(endpoints.size(), 2U);
42-
ASSERT_NE(endpoints.count(end_point1.get()), 0);
42+
ASSERT_NE(endpoints.count(end_point1.get()), 0UL);
4343
ASSERT_NE(endpoints.count(end_point2.get()), 0);
4444
}
4545

paddle/fluid/framework/selected_rows_test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ TEST(SelectedRows, SparseTable) {
9191
ASSERT_TRUE(table.HasKey(10));
9292
ASSERT_TRUE(table.HasKey(8));
9393
ASSERT_TRUE(table.HasKey(6));
94-
ASSERT_EQ(table.rows().size(), 3);
94+
ASSERT_EQ(table.rows().size(), 3UL);
9595

9696
framework::Tensor ids;
9797
ids.Resize(framework::make_ddim({4}));

paddle/fluid/operators/reader/reader_blocking_queue_test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ TEST(BlockingQueue, speed_test_mode) {
229229
q1.Receive(&b);
230230
EXPECT_EQ(b, i);
231231
}
232-
EXPECT_EQ(q1.Size(), 0);
232+
EXPECT_EQ(q1.Size(), 0UL);
233233

234234
BlockingQueue<size_t> q2(queue_size, true);
235235
for (size_t i = 0; i < queue_size; ++i) {

paddle/fluid/operators/sequence_unpad_op.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class SequenceUnpadOp : public framework::OperatorWithKernel {
5050
if (x_dims.size() == 2) {
5151
out_dims_vec.push_back(1);
5252
} else {
53-
for (size_t i = 2; i < x_dims.size(); ++i) {
53+
for (int i = 2; i < x_dims.size(); ++i) {
5454
out_dims_vec.push_back(x_dims[i]);
5555
}
5656
}

paddle/fluid/operators/sequence_unpad_op.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class SequenceUnpadOpKernel : public framework::OpKernel<T> {
6161
if (x_t->dims().size() == 2) {
6262
out_dims_vec.push_back(1);
6363
} else {
64-
for (size_t i = 2; i < x_t->dims().size(); ++i) {
64+
for (int i = 2; i < x_t->dims().size(); ++i) {
6565
out_dims_vec.push_back(x_t->dims()[i]);
6666
}
6767
}

0 commit comments

Comments
 (0)