File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,9 @@ class SplitIdsOpKernel : public framework::OpKernel<T> {
60
60
} else if (ids_var->IsType <framework::SelectedRows>()) {
61
61
const auto *ids_selected_rows = ctx.Input <framework::SelectedRows>(" Ids" );
62
62
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
+ " " );
64
66
const T *ids = ids_selected_rows->value ().data <T>();
65
67
const auto &ids_rows = ids_selected_rows->rows ();
66
68
auto outs = ctx.MultiOutput <framework::SelectedRows>(" Out" );
@@ -77,7 +79,7 @@ class SplitIdsOpKernel : public framework::OpKernel<T> {
77
79
framework::DDim ddim = framework::make_ddim (
78
80
{static_cast <int64_t >(out->rows ().size ()), row_width});
79
81
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) {
81
83
memcpy (output + i * row_width, ids + out->rows ()[i] * row_width,
82
84
row_width * sizeof (T));
83
85
}
Original file line number Diff line number Diff line change @@ -43,5 +43,5 @@ TEST(Chunk, Compressor) {
43
43
44
44
ch.Clear ();
45
45
ch.Parse (ss);
46
- ASSERT_EQ (ch.NumBytes (), 18 );
46
+ ASSERT_EQ (ch.NumBytes (), 18ul );
47
47
}
You can’t perform that action at this time.
0 commit comments