From 9322f8cbf51de19983bce257bff08078739a1224 Mon Sep 17 00:00:00 2001 From: hedaoyuan Date: Tue, 7 Mar 2017 10:16:40 +0800 Subject: [PATCH] Format --- paddle/gserver/gradientmachines/MultiGradientMachine.cpp | 5 +++-- paddle/gserver/gradientmachines/MultiGradientMachine.h | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/paddle/gserver/gradientmachines/MultiGradientMachine.cpp b/paddle/gserver/gradientmachines/MultiGradientMachine.cpp index e7db487e7..faadca69a 100644 --- a/paddle/gserver/gradientmachines/MultiGradientMachine.cpp +++ b/paddle/gserver/gradientmachines/MultiGradientMachine.cpp @@ -358,6 +358,7 @@ void MultiGradientMachine::getOutArgs(std::vector* outArgs, REGISTER_TIMER("waitOutArgs"); thread->waitOutArgsReady(); } + // outArgs_.size() only need to be calculated once. static int size = threads_[threads_.size() - 1]->getOutArgs().size(); outArgs_.resize(size); @@ -574,9 +575,9 @@ void TrainerThread::forward() { REGISTER_TIMER("thread_forward"); if (batchSize_ > 0) { gradientMachine_->forward( - inArgs_, &outArgs_, multiMachine_->getPassType()); + inArgs_, &outArgs_, multiMachine_->getPassType()); } else { - outArgs_.clear(); + outArgs_.clear(); } } outArgsReadySem_.post(); diff --git a/paddle/gserver/gradientmachines/MultiGradientMachine.h b/paddle/gserver/gradientmachines/MultiGradientMachine.h index 31bb28b6f..70203bbb9 100644 --- a/paddle/gserver/gradientmachines/MultiGradientMachine.h +++ b/paddle/gserver/gradientmachines/MultiGradientMachine.h @@ -470,7 +470,6 @@ protected: /// indicate whether inArgs is copied before forward() bool inArgsCopied_; - int batchSize_; }; -- GitLab