Skip to content

Commit b668938

Browse files
authored
Merge pull request #9914 from abhinavarora/split_ids_op_warning
Fix compiler warnings in split_op and chunks_test
2 parents 7b86da7 + 855992d commit b668938

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

paddle/fluid/operators/split_ids_op.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ class SplitIdsOpKernel : public framework::OpKernel<T> {
6060
} else if (ids_var->IsType<framework::SelectedRows>()) {
6161
const auto *ids_selected_rows = ctx.Input<framework::SelectedRows>("Ids");
6262
auto &ids_dims = ids_selected_rows->value().dims();
63-
PADDLE_ENFORCE_EQ(ids_dims[0], ids_selected_rows->rows().size(), "");
63+
PADDLE_ENFORCE_EQ(ids_dims[0],
64+
static_cast<int64_t>(ids_selected_rows->rows().size()),
65+
"");
6466
const T *ids = ids_selected_rows->value().data<T>();
6567
const auto &ids_rows = ids_selected_rows->rows();
6668
auto outs = ctx.MultiOutput<framework::SelectedRows>("Out");
@@ -77,7 +79,7 @@ class SplitIdsOpKernel : public framework::OpKernel<T> {
7779
framework::DDim ddim = framework::make_ddim(
7880
{static_cast<int64_t>(out->rows().size()), row_width});
7981
T *output = out->mutable_value()->mutable_data<T>(ddim, place);
80-
for (size_t i = 0; i < ddim[0]; ++i) {
82+
for (int64_t i = 0; i < ddim[0]; ++i) {
8183
memcpy(output + i * row_width, ids + out->rows()[i] * row_width,
8284
row_width * sizeof(T));
8385
}

paddle/fluid/recordio/chunk_test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,5 @@ TEST(Chunk, Compressor) {
4343

4444
ch.Clear();
4545
ch.Parse(ss);
46-
ASSERT_EQ(ch.NumBytes(), 18);
46+
ASSERT_EQ(ch.NumBytes(), 18ul);
4747
}

0 commit comments

Comments
 (0)