提交 621102dd 编写于 作者: W wangguibao

Naming convention

上级 ec7b1063
...@@ -78,7 +78,7 @@ void CreateTensor(Variable* var, proto::VarType::Type var_type) { ...@@ -78,7 +78,7 @@ void CreateTensor(Variable* var, proto::VarType::Type var_type) {
} }
} }
static void read_binary_file(const std::string& filename, static void ReadBinaryFile(const std::string& filename,
std::string* content) { std::string* content) {
std::string &contents = *content; std::string &contents = *content;
std::ifstream fin(filename, std::ios::in | std::ios::binary); std::ifstream fin(filename, std::ios::in | std::ios::binary);
...@@ -93,7 +93,7 @@ static void read_binary_file(const std::string& filename, ...@@ -93,7 +93,7 @@ static void read_binary_file(const std::string& filename,
fin.close(); fin.close();
} }
static void save_model( static void SaveModel(
const std::unique_ptr<ProgramDesc> & main_program, const std::unique_ptr<ProgramDesc> & main_program,
Scope* scope, Scope* scope,
const std::vector<std::string> & param_names, const std::vector<std::string> & param_names,
...@@ -142,7 +142,7 @@ static void save_model( ...@@ -142,7 +142,7 @@ static void save_model(
attrs); attrs);
save_op->Run(*scope, place); save_op->Run(*scope, place);
} }
} // end save_model } // end SaveModel
void ExecutorThreadWorker::AddTrainFile(const std::string& file) { void ExecutorThreadWorker::AddTrainFile(const std::string& file) {
...@@ -370,11 +370,11 @@ void ExecutorThreadWorker::Train() { ...@@ -370,11 +370,11 @@ void ExecutorThreadWorker::Train() {
// //
// currently comment it // currently comment it
LOG(ERROR) << "Going to save model " << modelfile; LOG(ERROR) << "Going to save model " << modelfile;
save_model(main_program_, SaveModel(main_program_,
thread_scope_, thread_scope_,
model_param_names_, model_param_names_,
model_filename, model_filename,
true); true);
} }
} }
} }
...@@ -462,7 +462,7 @@ void AsyncExecutor::RunStartupProgram(const ProgramDesc& program, ...@@ -462,7 +462,7 @@ void AsyncExecutor::RunStartupProgram(const ProgramDesc& program,
std::unique_ptr<ProgramDesc> AsyncExecutor::LoadDescFromFile( std::unique_ptr<ProgramDesc> AsyncExecutor::LoadDescFromFile(
const std::string& f) { const std::string& f) {
std::string program_desc_str; std::string program_desc_str;
read_binary_file(f, &program_desc_str); ReadBinaryFile(f, &program_desc_str);
std::unique_ptr<ProgramDesc> program(new ProgramDesc(program_desc_str)); std::unique_ptr<ProgramDesc> program(new ProgramDesc(program_desc_str));
return program; return program;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册