From cfde85bc52b55918906e4ad518211a07be907bd9 Mon Sep 17 00:00:00 2001 From: yangyaming Date: Wed, 8 Nov 2017 19:11:20 +0800 Subject: [PATCH] CallBack --> Callback --- paddle/function/FunctionTest.h | 12 ++++++------ paddle/function/MulValueOpTest.cpp | 9 +-------- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/paddle/function/FunctionTest.h b/paddle/function/FunctionTest.h index 2fc51a3aa8a..370940532ef 100644 --- a/paddle/function/FunctionTest.h +++ b/paddle/function/FunctionTest.h @@ -110,7 +110,7 @@ public: function2_(FunctionBase::funcRegistrar_.createByType(name2)) { function1_->init(config); function2_->init(config); - initArgsCallBack_ = nullptr; + initArgsCallback_ = nullptr; } ~Compare2Function() {} @@ -171,8 +171,8 @@ public: *seq2_)); } - void registerInitCallBack(std::function callback) { - initArgsCallBack_ = callback; + void registerInitCallback(std::function callback) { + initArgsCallback_ = callback; } // output need only contains shape, do not contains data. @@ -345,8 +345,8 @@ protected: initArg(*func1Inputs_[i]); } - if (initArgsCallBack_ != nullptr) { - initArgsCallBack_(*func1Inputs_[i], i); + if (initArgsCallback_ != nullptr) { + initArgsCallback_(*func1Inputs_[i], i); } copyArg_(*func1Inputs_[i], *func2Inputs_[i]); @@ -395,7 +395,7 @@ protected: std::shared_ptr seq1_; std::shared_ptr seq2_; test::CopyArgument copyArg_; - std::function initArgsCallBack_; + std::function initArgsCallback_; }; class CpuGpuFuncCompare diff --git a/paddle/function/MulValueOpTest.cpp b/paddle/function/MulValueOpTest.cpp index c1d5a3e5440..048660f34fc 100644 --- a/paddle/function/MulValueOpTest.cpp +++ b/paddle/function/MulValueOpTest.cpp @@ -16,13 +16,6 @@ limitations under the License. */ #include "FunctionTest.h" namespace paddle { -/* - for (size_t numSamples : {5, 32}) { - for (size_t channels : {5, 5, 32}) { - for (size_t imgSizeH : {5, 33, 100}) { - for (size_t imgSizeW : {5, 32, 96}) { - for (real value : {-0.5, 0.0, 0.5}) { -*/ TEST(MulValue, real) { for (size_t numSamples : {5, 32}) { @@ -46,7 +39,7 @@ TEST(MulValue, real) { compare.addInputs(BufferArg(VALUE_TYPE_FLOAT, shape)); compare.addInputs(BufferArg(VALUE_TYPE_FLOAT, indicesShape)); - compare.registerInitCallBack([=](BufferArg& arg, size_t index) { + compare.registerInitCallback([=](BufferArg& arg, size_t index) { if (index == 1) { real* data = (real*)arg.data(); -- GitLab