From e6bc7bb09ac8ce339626eef2514405e76701b976 Mon Sep 17 00:00:00 2001 From: Yu Yang Date: Mon, 16 Apr 2018 15:46:31 +0800 Subject: [PATCH] Tuning code --- paddle/fluid/pybind/pybind.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/paddle/fluid/pybind/pybind.cc b/paddle/fluid/pybind/pybind.cc index a1e8ff6399f..254c4a5942d 100644 --- a/paddle/fluid/pybind/pybind.cc +++ b/paddle/fluid/pybind/pybind.cc @@ -510,6 +510,11 @@ All parameter, weight, gradient are variables in Paddle. return &self.GetLocalScopes(); }, py::return_value_policy::reference) + .def("local_scopes_len", + [](ParallelExecutor &self) { return self.GetLocalScopes().size(); }) + .def("local_scope", [](ParallelExecutor &self, + size_t i) { return self.GetLocalScopes()[i]; }, + py::return_value_policy::reference) .def("run", &ParallelExecutor::Run); BindRecordIOWriter(&m); -- GitLab