From bc7db6cec944a8ab5099dfd8d0e03ebd5fa1eb60 Mon Sep 17 00:00:00 2001 From: Krzysztof Binias Date: Fri, 30 Nov 2018 15:25:44 +0100 Subject: [PATCH] Fix for accuracy problem for inplace operators when MKL-DNN mode is enabled test=develop --- paddle/fluid/framework/operator.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/paddle/fluid/framework/operator.cc b/paddle/fluid/framework/operator.cc index 2260353af7b..fc5036886a9 100644 --- a/paddle/fluid/framework/operator.cc +++ b/paddle/fluid/framework/operator.cc @@ -749,7 +749,7 @@ void OperatorWithKernel::RunImpl(const Scope& scope, kernel_iter->second(ExecutionContext(*this, exec_scope, *dev_ctx)); - if (!transfered_inplace_vars.empty()) { + if (run_by_executor_ && !transfered_inplace_vars.empty()) { // there is inplace variable has been transfered. TransferInplaceVarsBack(scope, transfered_inplace_vars, *transfer_scope); } @@ -771,6 +771,7 @@ void OperatorWithKernel::RunImpl(const Scope& scope, } } } + void OperatorWithKernel::TransferInplaceVarsBack( const Scope& scope, const std::vector& inplace_vars, const Scope& transfer_scope) const { -- GitLab