diff --git a/paddle/fluid/operators/split_ids_op.h b/paddle/fluid/operators/split_ids_op.h index ba1e903dbb6daaa86b1b664322d100a800fd16b3..d263426e073d95ad6d584c7370baf596587a993d 100644 --- a/paddle/fluid/operators/split_ids_op.h +++ b/paddle/fluid/operators/split_ids_op.h @@ -60,7 +60,9 @@ class SplitIdsOpKernel : public framework::OpKernel { } else if (ids_var->IsType()) { const auto *ids_selected_rows = ctx.Input("Ids"); auto &ids_dims = ids_selected_rows->value().dims(); - PADDLE_ENFORCE_EQ(ids_dims[0], ids_selected_rows->rows().size(), ""); + PADDLE_ENFORCE_EQ(ids_dims[0], + static_cast(ids_selected_rows->rows().size()), + ""); const T *ids = ids_selected_rows->value().data(); const auto &ids_rows = ids_selected_rows->rows(); auto outs = ctx.MultiOutput("Out"); @@ -77,7 +79,7 @@ class SplitIdsOpKernel : public framework::OpKernel { framework::DDim ddim = framework::make_ddim( {static_cast(out->rows().size()), row_width}); T *output = out->mutable_value()->mutable_data(ddim, place); - for (size_t i = 0; i < ddim[0]; ++i) { + for (int64_t i = 0; i < ddim[0]; ++i) { memcpy(output + i * row_width, ids + out->rows()[i] * row_width, row_width * sizeof(T)); }