提交 9322f8cb 编写于 作者: H hedaoyuan

Format

上级 b1c22b67
...@@ -358,6 +358,7 @@ void MultiGradientMachine::getOutArgs(std::vector<Argument>* outArgs, ...@@ -358,6 +358,7 @@ void MultiGradientMachine::getOutArgs(std::vector<Argument>* outArgs,
REGISTER_TIMER("waitOutArgs"); REGISTER_TIMER("waitOutArgs");
thread->waitOutArgsReady(); thread->waitOutArgsReady();
} }
// outArgs_.size() only need to be calculated once. // outArgs_.size() only need to be calculated once.
static int size = threads_[threads_.size() - 1]->getOutArgs().size(); static int size = threads_[threads_.size() - 1]->getOutArgs().size();
outArgs_.resize(size); outArgs_.resize(size);
...@@ -574,9 +575,9 @@ void TrainerThread::forward() { ...@@ -574,9 +575,9 @@ void TrainerThread::forward() {
REGISTER_TIMER("thread_forward"); REGISTER_TIMER("thread_forward");
if (batchSize_ > 0) { if (batchSize_ > 0) {
gradientMachine_->forward( gradientMachine_->forward(
inArgs_, &outArgs_, multiMachine_->getPassType()); inArgs_, &outArgs_, multiMachine_->getPassType());
} else { } else {
outArgs_.clear(); outArgs_.clear();
} }
} }
outArgsReadySem_.post(); outArgsReadySem_.post();
......
...@@ -470,7 +470,6 @@ protected: ...@@ -470,7 +470,6 @@ protected:
/// indicate whether inArgs is copied before forward() /// indicate whether inArgs is copied before forward()
bool inArgsCopied_; bool inArgsCopied_;
int batchSize_; int batchSize_;
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册