提交 05208e1f 编写于 作者: Q Qiao Longfei

optimize code

test=develop
上级 9af76ade
...@@ -261,7 +261,8 @@ static inline void parse_csv_line( ...@@ -261,7 +261,8 @@ static inline void parse_csv_line(
string_split(slot_data, ',', &data_in_slot_str); string_split(slot_data, ',', &data_in_slot_str);
std::vector<int64_t> data_in_slot; std::vector<int64_t> data_in_slot;
for (auto& data_str : data_in_slot_str) { for (auto& data_str : data_in_slot_str) {
(*sparse_datas)[i].push_back(std::stol(data_str)); auto id = std::stol(data_str);
(*sparse_datas)[i].push_back(id);
} }
} }
} }
......
...@@ -36,7 +36,6 @@ class ReadInferShape : public framework::InferShapeBase { ...@@ -36,7 +36,6 @@ class ReadInferShape : public framework::InferShapeBase {
ctx->SetOutputsDim("Out", reader_dims); ctx->SetOutputsDim("Out", reader_dims);
auto in_desc = auto in_desc =
boost::get<framework::VarDesc*>(ctx->GetInputVarPtrs("Reader")[0]); boost::get<framework::VarDesc*>(ctx->GetInputVarPtrs("Reader")[0]);
std::cout << in_desc->Proto()->SerializeAsString() << std::endl;
auto in_lod_levels = in_desc->GetLoDLevels(); auto in_lod_levels = in_desc->GetLoDLevels();
auto out_var_ptrs = ctx->GetOutputVarPtrs("Out"); auto out_var_ptrs = ctx->GetOutputVarPtrs("Out");
PADDLE_ENFORCE_EQ(in_lod_levels.size(), out_var_ptrs.size(), PADDLE_ENFORCE_EQ(in_lod_levels.size(), out_var_ptrs.size(),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册