From 26b228e40596bd50c4d590317a44963aa5bf0ea5 Mon Sep 17 00:00:00 2001 From: tangwei12 Date: Thu, 16 Aug 2018 16:12:17 +0800 Subject: [PATCH] remove assignment and add vlog --- paddle/fluid/operators/sum_mkldnn_op.cc | 11 ++++++----- paddle/fluid/operators/sum_op.h | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/paddle/fluid/operators/sum_mkldnn_op.cc b/paddle/fluid/operators/sum_mkldnn_op.cc index c2cf13f7b..4ccf6b87d 100644 --- a/paddle/fluid/operators/sum_mkldnn_op.cc +++ b/paddle/fluid/operators/sum_mkldnn_op.cc @@ -34,15 +34,15 @@ namespace paddle { namespace operators { -using paddle::framework::Tensor; -using paddle::platform::MKLDNNDeviceContext; -using paddle::platform::CPUDeviceContext; using framework::DataLayout; using mkldnn::memory; using mkldnn::primitive; +using mkldnn::reorder; using mkldnn::stream; using mkldnn::sum; -using mkldnn::reorder; +using paddle::framework::Tensor; +using paddle::platform::CPUDeviceContext; +using paddle::platform::MKLDNNDeviceContext; using platform::to_void_cast; template @@ -186,8 +186,9 @@ class SumMKLDNNOpKernel : public paddle::framework::OpKernel { } if (in_dim.empty()) { - in_dim = framework::vectorize(get_selected_row(N - 1).value().dims()); + VLOG(3) << "WARNING: all the inputs are empty" } + in_dim[0] = static_cast(first_dim); out_value->Resize(framework::make_ddim(in_dim)); diff --git a/paddle/fluid/operators/sum_op.h b/paddle/fluid/operators/sum_op.h index 22a97fff3..65ab91405 100644 --- a/paddle/fluid/operators/sum_op.h +++ b/paddle/fluid/operators/sum_op.h @@ -115,7 +115,7 @@ class SumKernel : public framework::OpKernel { } } if (in_dim.empty()) { - in_dim = framework::vectorize(get_selected_row(N - 1).value().dims()); + VLOG(3) << "WARNING: all the inputs are empty" } in_dim[0] = static_cast(first_dim); -- GitLab