Skip to content

Commit

Permalink
Unique key for input data
Browse files Browse the repository at this point in the history
  • Loading branch information
kbinias committed May 21, 2018
1 parent 32929cd commit 24904b9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions paddle/fluid/operators/activation_mkldnn_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ void eltwise_forward(const ExecContext &ctx, mkldnn::algorithm algorithm,
std::vector<int> 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";
Expand Down Expand Up @@ -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<T *>(dev_ctx.GetBlob(key_src_data));

Expand Down

0 comments on commit 24904b9

Please sign in to comment.