From 63e3150772557e311e32914c44c0f22420ecb52d Mon Sep 17 00:00:00 2001 From: Yang Yu Date: Wed, 3 Jan 2018 17:13:35 +0800 Subject: [PATCH] Update code --- paddle/framework/lod_tensor.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/paddle/framework/lod_tensor.cc b/paddle/framework/lod_tensor.cc index 7b6dc09bdb5..92b3d7fccd1 100644 --- a/paddle/framework/lod_tensor.cc +++ b/paddle/framework/lod_tensor.cc @@ -177,6 +177,9 @@ void AppendLoD(LoD *lod, const LoD &lod_length) { lod->empty() || lod->size() == lod_length.size(), "The lod_length should has the same size with the appended lod."); if (lod->empty()) { + for (size_t i = 0; i < lod_length.size(); ++i) { + lod->emplace_back(1, 0); // size = 1, value = 0; + } *lod = LoD(lod_length.size(), std::vector({0})); } for (size_t i = 0; i < lod->size(); ++i) { -- GitLab