From 52854e884efdaeaa5e9cf0bce02ceb3f57dc0bf4 Mon Sep 17 00:00:00 2001 From: xiaolil1 Date: Wed, 28 Nov 2018 17:09:44 +0800 Subject: [PATCH] fix int8 init for src data reorder --- paddle/fluid/operators/conv_mkldnn_op.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/paddle/fluid/operators/conv_mkldnn_op.cc b/paddle/fluid/operators/conv_mkldnn_op.cc index 2dd67c31080..1b895c5fa5f 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(); -- GitLab