未验证 提交 ccc594e4 编写于 作者: K Kexin Zhao 提交者: GitHub

need to copy LoD info (#10392)

上级 773bf29b
...@@ -106,6 +106,8 @@ class SaveOp : public framework::OperatorBase { ...@@ -106,6 +106,8 @@ class SaveOp : public framework::OperatorBase {
auto out_kernel_type = framework::OpKernelType(out_dtype, place); auto out_kernel_type = framework::OpKernelType(out_dtype, place);
framework::LoDTensor out; framework::LoDTensor out;
framework::TransDataType(in_kernel_type, out_kernel_type, tensor, &out); framework::TransDataType(in_kernel_type, out_kernel_type, tensor, &out);
// copy LoD info to the new tensor
out.set_lod(tensor.lod());
framework::SerializeToStream(fout, out, dev_ctx); framework::SerializeToStream(fout, out, dev_ctx);
} else { } else {
framework::SerializeToStream(fout, tensor, dev_ctx); framework::SerializeToStream(fout, tensor, dev_ctx);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册