From 94e0a673b83dbfcb6b547b93917a45d044b22dcc Mon Sep 17 00:00:00 2001 From: xiaolil1 Date: Thu, 25 Oct 2018 16:02:12 +0800 Subject: [PATCH] Revert "fix conv int8 reorder mask" This reverts commit 00970fb8757599dc699840e6ec62c397de54cfa7. --- paddle/fluid/operators/conv_mkldnn_op.cc | 45 ++++-------------------- paddle/fluid/operators/dequantize_op.cc | 2 +- paddle/fluid/operators/quantize_op.cc | 32 ++--------------- 3 files changed, 11 insertions(+), 68 deletions(-) diff --git a/paddle/fluid/operators/conv_mkldnn_op.cc b/paddle/fluid/operators/conv_mkldnn_op.cc index 6a6ef818927..64be8a4b163 100644 --- a/paddle/fluid/operators/conv_mkldnn_op.cc +++ b/paddle/fluid/operators/conv_mkldnn_op.cc @@ -350,59 +350,27 @@ std::cout<<"fuse_relu = "<1? weights_tz[1]*weights_tz[0] : weights_tz[0]) : 1; float scale_in_data = *(scale_in->data()); - -for(int i=0; i<50; i++){ - printf("%f ", (float)(input_data[i])/scale_in_data); -} -printf("\n");fflush(stdout); - -std::cout<<"scale_in_data = "< scale_weights_data(count); -std::cout<<"scale_weights_data = "; for(int i=0; idata() + i); -std::cout<data()); -std::cout<<"scale_out_data = "<data()); -std::cout<<"scale_in_eltwise_data = "<(output_data)); auto reorder_pd = std::shared_ptr( - new reorder::primitive_desc(src_pd, dst_pd, attri)); + new reorder::primitive_desc(dst_pd, src_pd, attri)); auto reorder_p= std::shared_ptr(new reorder(*reorder_pd, *src_memory_p, dst_memory)); pipeline.push_back(*reorder_p); diff --git a/paddle/fluid/operators/quantize_op.cc b/paddle/fluid/operators/quantize_op.cc index 1748e645d76..cb5a9e4c1c8 100644 --- a/paddle/fluid/operators/quantize_op.cc +++ b/paddle/fluid/operators/quantize_op.cc @@ -47,35 +47,9 @@ std::cout<<"this is quantize op!!!!!!!!!!!!!!"< dst_tz = paddle::framework::vectorize2int(output->dims()); const T* input_data = input->data(); - uint8_t* output_data = output->mutable_data(ctx.GetPlace()); + T* output_data = output->mutable_data(ctx.GetPlace()); std::vector scale_data = {*(scale->data())}; -FILE *fp = fopen("quant_input.txt","w"); -printf("quantize check!!!!\n"); -std::vector tz = paddle::framework::vectorize2int(input->dims()); -int count=1; -for(int i=0; i(output_data)); + auto dst_memory = mkldnn::memory(dst_pd, to_void_cast(output_data)); auto reorder_pd = std::shared_ptr( - new reorder::primitive_desc(src_pd, dst_pd, attri)); + new reorder::primitive_desc(dst_pd, src_pd, attri)); auto reorder_p= std::shared_ptr(new reorder(*reorder_pd, *src_memory_p, dst_memory)); pipeline.push_back(*reorder_p); -- GitLab