From 24904b914cf2671dc43b248f31136bdb6e79c887 Mon Sep 17 00:00:00 2001 From: Krzysztof Binias Date: Mon, 21 May 2018 12:19:02 +0200 Subject: [PATCH] Unique key for input data --- paddle/fluid/operators/activation_mkldnn_op.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/paddle/fluid/operators/activation_mkldnn_op.cc b/paddle/fluid/operators/activation_mkldnn_op.cc index fa9f78db5..b892ac77d 100644 --- a/paddle/fluid/operators/activation_mkldnn_op.cc +++ b/paddle/fluid/operators/activation_mkldnn_op.cc @@ -58,7 +58,8 @@ void eltwise_forward(const ExecContext &ctx, mkldnn::algorithm algorithm, std::vector src_tz = framework::vectorize2int(src->dims()); const std::string key = gethash(src_tz, algorithm); - const std::string key_src_data = key + "@eltwise_fwd_src_data"; + const std::string key_src_data = + key + ctx.op().Output("Out") + "@eltwise_fwd_src_data"; const std::string key_src_mem = key + "@eltwise_fwd_src_mem"; const std::string key_dst_mem = key + "@eltwise_fwd_dst_mem"; const std::string key_fwd = key + "@eltwise_fwd"; @@ -140,7 +141,8 @@ void eltwise_grad(const ExecContext &ctx, mkldnn::algorithm algorithm, const std::string key_diff_dst_mem = key + "@eltwise_diff_dst_mem"; const std::string key_grad = key + "@eltwise_grad"; - const std::string key_src_data = key + "@eltwise_fwd_src_data"; + const std::string key_src_data = + key + ctx.op().Input("Out") + "@eltwise_fwd_src_data"; const auto p_src_data = std::static_pointer_cast(dev_ctx.GetBlob(key_src_data)); -- GitLab