提交 17f9be55 编写于 作者: T typhoonzero

update for multi trainer

上级 f8f80db1
...@@ -95,6 +95,12 @@ class RecvOp : public framework::OperatorBase { ...@@ -95,6 +95,12 @@ class RecvOp : public framework::OperatorBase {
} }
VLOG(10) << "recved grad: " << grad_var_name VLOG(10) << "recved grad: " << grad_var_name
<< " updating param: " << param_var_name; << " updating param: " << param_var_name;
auto *merged_grad = recv_scope.FindVar(grad_var_name);
if (merged_grad == nullptr) {
// create output of merged var.
recv_scope.Var(grad_var_name);
}
if (trainer_count > 1) { if (trainer_count > 1) {
grad_var_name = this->GetGradVarNameForTrainer(grad_var_name); grad_var_name = this->GetGradVarNameForTrainer(grad_var_name);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册