diff --git a/paddle/gserver/layers/WarpCTCLayer.cpp b/paddle/gserver/layers/WarpCTCLayer.cpp index 23ca5257b6d2c8c6e88ad4bb92de6dc3f18fafe3..94e926a8d8f678c91b5c0614a78ba829869ec150 100644 --- a/paddle/gserver/layers/WarpCTCLayer.cpp +++ b/paddle/gserver/layers/WarpCTCLayer.cpp @@ -31,7 +31,6 @@ bool WarpCTCLayer::init(const LayerMap& layerMap, CHECK_EQ(numClasses_, inputLayers_[0]->getSize()); blank_ = config_.blank(); - CHECK_GE(blank_, 0UL); CHECK_LT(blank_, numClasses_); normByTimes_ = config_.norm_by_times(); diff --git a/paddle/pserver/ParameterClient2.cpp b/paddle/pserver/ParameterClient2.cpp index 887168075e307b4056ea4bc500665446d30228fe..86fd1c5276c97f2de86b8c8eb8627721611d099c 100644 --- a/paddle/pserver/ParameterClient2.cpp +++ b/paddle/pserver/ParameterClient2.cpp @@ -611,10 +611,7 @@ void PreparedOperations::addOperationHelper(Operation* op, CpuMatrixPtr mat) { pmat.mutable_values(), mat->getData(), pmat.num_cols() * pmat.num_rows()); } -template -static inline auto add(T1 a, T2 b) -> decltype(a + b) { - return a + b; -} +static inline real addTwo(real a, double b) { return a + b; } void ParameterClient2::doOperation(PreparedOperations& ops, bool waitForGradient, @@ -684,7 +681,7 @@ void ParameterClient2::doOperation(PreparedOperations& ops, rvec->getData() + rvec->getSize(), vec.values().data(), rvec->getData(), - add); + addTwo); } CHECK_EQ(resultMatrices.size(), (size_t)result.matrices_size()); @@ -699,7 +696,7 @@ void ParameterClient2::doOperation(PreparedOperations& ops, rmat->getData() + rmat->getElementCnt(), mat.values().data(), rmat->getData(), - add); + addTwo); } } }