提交 a848303e 编写于 作者: X Xin Pan

follow comments

上级 722c078b
...@@ -350,9 +350,12 @@ void Executor::RunPreparedContext(ExecutorPrepareContext* ctx, Scope* scope, ...@@ -350,9 +350,12 @@ void Executor::RunPreparedContext(ExecutorPrepareContext* ctx, Scope* scope,
} }
} }
} }
// platform::DeviceContextPool::Instance().Get(place_)->Wait(); platform::DeviceContextPool::Instance().Get(place_)->Wait();
if (create_vars && create_local_scope) { if (create_vars && create_local_scope) {
scope->DeleteScope(local_scope); scope->DeleteScope(local_scope);
} else {
// Delete the local scopes created in operators.
scope->DropKids();
} }
if (FLAGS_benchmark) { if (FLAGS_benchmark) {
VLOG(2) << "-------------------------------------------------------"; VLOG(2) << "-------------------------------------------------------";
......
...@@ -31,6 +31,10 @@ limitations under the License. */ ...@@ -31,6 +31,10 @@ limitations under the License. */
namespace paddle { namespace paddle {
namespace operators { namespace operators {
namespace detail { namespace detail {
namespace {
const int kStartProfile = 1;
const int kStopProfile = 2;
} // namespace
using VarMsg = sendrecv::VariableMessage; using VarMsg = sendrecv::VariableMessage;
...@@ -124,9 +128,9 @@ void SerializeToByteBuffer(const std::string& name, framework::Variable* var, ...@@ -124,9 +128,9 @@ void SerializeToByteBuffer(const std::string& name, framework::Variable* var,
// trainer. // trainer.
if (platform::ShouldSendProfileState()) { if (platform::ShouldSendProfileState()) {
if (platform::IsProfileEnabled()) { if (platform::IsProfileEnabled()) {
request.set_profile(1); request.set_profile(kStartProfile);
} else { } else {
request.set_profile(2); request.set_profile(kStopProfile);
} }
} }
if (!out_name.empty()) { if (!out_name.empty()) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册