提交 147bf00f 编写于 作者: Q qiaolongfei

clear mutable rows for the output of split_ids_op

上级 4e0f5c2a
...@@ -68,6 +68,9 @@ class SplitIdsOpKernel : public framework::OpKernel<T> { ...@@ -68,6 +68,9 @@ class SplitIdsOpKernel : public framework::OpKernel<T> {
const auto &ids_rows = ids_selected_rows->rows(); const auto &ids_rows = ids_selected_rows->rows();
auto outs = ctx.MultiOutput<framework::SelectedRows>("Out"); auto outs = ctx.MultiOutput<framework::SelectedRows>("Out");
const size_t shard_num = outs.size(); const size_t shard_num = outs.size();
for (auto &out : outs) {
out->mutable_rows()->clear();
}
// get rows for outputs // get rows for outputs
std::unordered_map<int64_t, size_t> id_to_index; std::unordered_map<int64_t, size_t> id_to_index;
for (size_t i = 0; i < ids_rows.size(); ++i) { for (size_t i = 0; i < ids_rows.size(); ++i) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册