|
|
|
@ -498,16 +498,17 @@ All parameter, weight, gradient are variables in Paddle.
|
|
|
|
|
m.def("reset_profiler", platform::ResetProfiler);
|
|
|
|
|
|
|
|
|
|
py::class_<ParallelExecutor>(m, "ParallelExecutor")
|
|
|
|
|
.def(
|
|
|
|
|
"__init__",
|
|
|
|
|
[](ParallelExecutor &self, const std::vector<platform::Place> &places,
|
|
|
|
|
const std::unordered_set<std::string> ¶ms,
|
|
|
|
|
const ProgramDesc &startup_program,
|
|
|
|
|
const ProgramDesc &main_program, const std::string &loss_var_name,
|
|
|
|
|
Scope *scope) {
|
|
|
|
|
new (&self) ParallelExecutor(places, params, startup_program,
|
|
|
|
|
main_program, loss_var_name, scope);
|
|
|
|
|
})
|
|
|
|
|
.def("__init__",
|
|
|
|
|
[](ParallelExecutor &self, size_t num_threads,
|
|
|
|
|
const std::vector<platform::Place> &places,
|
|
|
|
|
const std::unordered_set<std::string> ¶ms,
|
|
|
|
|
const ProgramDesc &startup_program,
|
|
|
|
|
const ProgramDesc &main_program, const std::string &loss_var_name,
|
|
|
|
|
Scope *scope) {
|
|
|
|
|
new (&self)
|
|
|
|
|
ParallelExecutor(num_threads, places, params, startup_program,
|
|
|
|
|
main_program, loss_var_name, scope);
|
|
|
|
|
})
|
|
|
|
|
.def("run", &ParallelExecutor::Run);
|
|
|
|
|
|
|
|
|
|
BindRecordIOWriter(m);
|
|
|
|
|