diff --git a/paddle/fluid/operators/conv_mkldnn_op.cc b/paddle/fluid/operators/conv_mkldnn_op.cc index 2dd67c3108095e9c3b3152d67701c267330320e3..1b895c5fa5ff81bf69761ff9576e330b90b86d4f 100644 --- a/paddle/fluid/operators/conv_mkldnn_op.cc +++ b/paddle/fluid/operators/conv_mkldnn_op.cc @@ -686,7 +686,7 @@ class ConvMKLDNNOpKernel : public paddle::framework::OpKernel { handler.reset(new ConvMKLDNNHandler(conv_pd, dev_ctx, mkldnn_engine, key)); // create mkldnn memory from input tensors (data/weights) - auto user_src_memory_p = + user_src_memory_p = handler->AcquireSrcMemory(user_src_md, to_void_cast(input_data)); auto user_weights_memory_p = handler->AcquireWeightsMemory( user_weights_md, to_void_cast(filter_data)); @@ -773,6 +773,9 @@ class ConvMKLDNNOpKernel : public paddle::framework::OpKernel { output->set_layout(DataLayout::kMKLDNN); output->set_format(GetMKLDNNFormat(*dst_memory_p)); } else { + if(src_memory_reorder_p){ + pipeline.push_back(*src_memory_reorder_p); + } pipeline.push_back(*conv_p); stream(stream::kind::eager).submit(pipeline).wait();