Skip to content
Snippets Groups Projects
Commit c6ac67d5 authored by Yi Zhu's avatar Yi Zhu Committed by Will Zhang
Browse files

fix: fix bug when elem in model < split num (#911)

* fix bug when elem cnt in model < split num

* add checker
parent e9630113
No related branches found
No related tags found
No related merge requests found
......@@ -8,11 +8,13 @@ void ReduceGatherKernel::ForwardDataContent(
char* dst_cur_dptr = out_blob->mut_dptr<char>();
for (const std::string& ibn : this->op_attribute().input_bns()) {
Blob* in_blob = BnInOp2Blob(ibn);
if (!in_blob) { break; }
size_t in_byte_size = in_blob->ByteSizeOfDataContentField();
AutoMemcpy(ctx.device_ctx, dst_cur_dptr, in_blob->dptr<char>(), in_byte_size,
in_blob->mem_case(), out_blob->mem_case());
dst_cur_dptr += in_byte_size;
}
CHECK_EQ(dst_cur_dptr - out_blob->mut_dptr<char>(), out_blob->ByteSizeOfDataContentField());
}
REGISTER_KERNEL(OperatorConf::kReduceGatherConf, ReduceGatherKernel);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment