From 4416c793af53d199e055c44750bac4f34f43c1e6 Mon Sep 17 00:00:00 2001 From: wangguanqun Date: Fri, 20 Aug 2021 15:56:22 +0800 Subject: [PATCH] fix set_lod in data_feed (#35000) * add trainer desc config to distributed strategy * code style modified * data_feed set lod --- paddle/fluid/framework/data_feed.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/paddle/fluid/framework/data_feed.cc b/paddle/fluid/framework/data_feed.cc index cc4609a740f..87afda45962 100644 --- a/paddle/fluid/framework/data_feed.cc +++ b/paddle/fluid/framework/data_feed.cc @@ -847,8 +847,10 @@ void MultiSlotDataFeed::PutToFeedVec( total_instance * sizeof(int64_t)); } - LoD data_lod{offset}; - feed_vec_[i]->set_lod(data_lod); + if (!use_slots_is_dense_[i]) { + LoD data_lod{offset}; + feed_vec_[i]->set_lod(data_lod); + } if (use_slots_is_dense_[i]) { if (inductive_shape_index_[i] != -1) { use_slots_shape_[i][inductive_shape_index_[i]] = @@ -1206,8 +1208,10 @@ void MultiSlotInMemoryDataFeed::PutToFeedVec( } auto& slot_offset = offset_[i]; if (this->input_type_ == 0) { - LoD data_lod{slot_offset}; - feed_vec_[i]->set_lod(data_lod); + if (!use_slots_is_dense_[i]) { + LoD data_lod{slot_offset}; + feed_vec_[i]->set_lod(data_lod); + } } else if (this->input_type_ == 1) { if (!use_slots_is_dense_[i]) { std::vector tmp_offset; -- GitLab