From e821b12f57487f2ecab8debb13531adc05dd9453 Mon Sep 17 00:00:00 2001 From: Brian Liu Date: Tue, 25 Dec 2018 14:48:02 +0800 Subject: [PATCH] Fix issue which cause abnormal CPU usage in stack op Stack OP has much higher CPU cost than expected in release mode. Caused by DebugStringEx() in base class OperatorWithKernel. Actually this issue occur for each OP which hasn't implement it's own GetExpectedKernelType(). test=develop --- paddle/fluid/framework/operator.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paddle/fluid/framework/operator.cc b/paddle/fluid/framework/operator.cc index fec311e3ee..f48e403cef 100644 --- a/paddle/fluid/framework/operator.cc +++ b/paddle/fluid/framework/operator.cc @@ -1061,8 +1061,8 @@ proto::VarType::Type OperatorWithKernel::IndicateDataType( t = &(var->Get().value()); } if (t != nullptr) { - PADDLE_ENFORCE(t->IsInitialized(), "Input %s is not initialized: %s", - ipt_name, DebugString()); + PADDLE_ENFORCE(t->IsInitialized(), "Input %s is not initialized", + ipt_name); int tmp = static_cast(t->type()); PADDLE_ENFORCE( tmp == data_type || data_type == -1, -- GitLab