提交 03f418c5 编写于 作者: F fengjiayi

Fix compile error

上级 f77c63b8
...@@ -78,18 +78,16 @@ static std::shared_ptr<OperatorBase> BackwardImpl( ...@@ -78,18 +78,16 @@ static std::shared_ptr<OperatorBase> BackwardImpl(
std::string prefix = grad_input.substr( std::string prefix = grad_input.substr(
0, grad_input.size() - OperatorBase::GRAD_VAR_SUFFIX().size()); 0, grad_input.size() - OperatorBase::GRAD_VAR_SUFFIX().size());
grad_input = prefix + OperatorBase::ZERO_VAR_SUFFIX(); grad_input = prefix + OperatorBase::ZERO_VAR_SUFFIX();
std::vector<std::string> fill_zeros_in = {prefix}; net->AddOp(OpRegistry::CreateOp("fill_zeros_like", {prefix},
std::vector<std::string> fill_zeros_out = {grad_input}; {grad_input}, {}));
net.AddOp(OpRegistry::CreateOp("fill_zeros_like", fill_zeros_in,
fill_zeros_out, AttributeMap()));
} }
} }
for (std::string& grad_output : grad_op->output_) { for (std::string& grad_output : grad_op->outputs_) {
if (no_grad_names.count(grad_output)) { if (no_grad_names.count(grad_output)) {
grad_output = OperatorBase::EMPTY_VAR_NAME(); grad_output = OperatorBase::EMPTY_VAR_NAME();
} }
} }
net.AddOp(grad_op); net->AddOp(grad_op);
} }
net->CompleteAddOp(); net->CompleteAddOp();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册