From bea06095c1da6664abd0344308b47b460cb0b759 Mon Sep 17 00:00:00 2001 From: Alexander Zai Date: Tue, 28 Aug 2018 08:15:31 -0700 Subject: [PATCH] revert in place diff --- src/executor/attach_op_execs_pass.cc | 4 ++-- src/operator/nn/mkldnn/mkldnn_base-inl.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/executor/attach_op_execs_pass.cc b/src/executor/attach_op_execs_pass.cc index c619961a2f24..0e415ef5112a 100644 --- a/src/executor/attach_op_execs_pass.cc +++ b/src/executor/attach_op_execs_pass.cc @@ -159,7 +159,7 @@ class StatefulComputeExExecutor : public OpExecutor { op_ctx.run_ctx = rctx; #if MXNET_USE_MKLDNN == 1 InvalidateOutputs(out_array, req); - CreateDefaultInputs(in_array, in_array_fallback); + CreateDefaultInputs(in_array, &in_array_fallback); fcompute_(state_, op_ctx, in_array_fallback, req, out_array); return; #endif @@ -232,7 +232,7 @@ class FComputeExExecutor : public OpExecutor { // TODO(alex): (MXNET-847) Remove this fallback feature after subgraph implemented const auto is_mkldnn = Op::GetAttr("TIsMKLDNN"); if (!is_mkldnn.get(attrs_.op, false)) { - CreateDefaultInputs(in_array, in_array_fallback); + CreateDefaultInputs(in_array, &in_array_fallback); fcompute_(attrs_, op_ctx, in_array_fallback, req, out_array); return; } diff --git a/src/operator/nn/mkldnn/mkldnn_base-inl.h b/src/operator/nn/mkldnn/mkldnn_base-inl.h index 64a67237f6f9..edddd2b699ee 100644 --- a/src/operator/nn/mkldnn/mkldnn_base-inl.h +++ b/src/operator/nn/mkldnn/mkldnn_base-inl.h @@ -358,12 +358,12 @@ static inline void InvalidateOutputs(const std::vector &arrs, // TODO(alexzai): (MXNET-856) Remove helper function after subgraph feature added static inline void CreateDefaultInputs(const std::vector &arrs, - const std::vector &out_arrs) { + std::vector *out_arrs) { for (size_t i = 0; i < arrs.size(); ++i) { if (arrs[i].IsMKLDNNData()) - out_arrs[i] = arrs[i].Reorder2Default(); + out_arrs->emplace_back(arrs[i].Reorder2Default()); else - out_arrs[i] = arrs[i]; + out_arrs->emplace_back(arrs[i]); } }