Skip to content

Commit 9b63b7d

Browse files
author
Abhinav Arora
committed
Fix warnings in split_ids_op
1 parent 59234b7 commit 9b63b7d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
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
}

0 commit comments

Comments
 (0)