From b6dfd2891bd658e1212f5e38bf764cf0f901574f Mon Sep 17 00:00:00 2001 From: backyes Date: Wed, 18 Jan 2017 18:14:41 +0800 Subject: [PATCH] fix bug: * update function can not be inherited since updateImpl exsits * remove update implementation in one inherited updater --- paddle/parameter/ParameterUpdaterBase.h | 2 +- paddle/trainer/ParameterUpdater.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/paddle/parameter/ParameterUpdaterBase.h b/paddle/parameter/ParameterUpdaterBase.h index b230e170c15..6265c828a1a 100644 --- a/paddle/parameter/ParameterUpdaterBase.h +++ b/paddle/parameter/ParameterUpdaterBase.h @@ -55,7 +55,7 @@ public: // between startBatch() and finishBatch(), update() will be called // by the trainer multiple times, each time for updating one Parameter // with its gradient in PARAMETER_GRADIENT - virtual void update(Parameter* para) { + void update(Parameter* para) { SetDevice setDevice(para->getDeviceId()); para->updateHook(); this->updateImpl(para); diff --git a/paddle/trainer/ParameterUpdater.h b/paddle/trainer/ParameterUpdater.h index c3207e63ce7..9e9e948b885 100644 --- a/paddle/trainer/ParameterUpdater.h +++ b/paddle/trainer/ParameterUpdater.h @@ -184,7 +184,6 @@ protected: * @param para */ virtual void updateImpl(Parameter* para) {} - virtual void update(Parameter* para) {} }; /** -- GitLab