未验证 提交 4626afa4 编写于 作者: S ShenLiang 提交者: GitHub

fix traverse graph in reducer (#32721)

上级 d19b5da0
...@@ -443,10 +443,6 @@ void Reducer::PrepareDeps(const std::unordered_set<GradOpNode *> &init_nodes) { ...@@ -443,10 +443,6 @@ void Reducer::PrepareDeps(const std::unordered_set<GradOpNode *> &init_nodes) {
auto *cur_node = q.front(); auto *cur_node = q.front();
q.pop(); q.pop();
for (auto &cur_op : *cur_node) {
cur_op.EnforceHasInOut();
}
const auto &grad_pending_nodes = cur_node->GradPendingNodes(); const auto &grad_pending_nodes = cur_node->GradPendingNodes();
for (auto &grad_pending_node : grad_pending_nodes) { for (auto &grad_pending_node : grad_pending_nodes) {
PADDLE_ENFORCE_NOT_NULL( PADDLE_ENFORCE_NOT_NULL(
...@@ -523,7 +519,6 @@ void Reducer::PrepareForBackward( ...@@ -523,7 +519,6 @@ void Reducer::PrepareForBackward(
q.pop(); q.pop();
for (const auto &cur_op : *cur_node) { for (const auto &cur_op : *cur_node) {
cur_op.EnforceHasInOut();
auto &bwd_outs = cur_op.GetOutsMap(); auto &bwd_outs = cur_op.GetOutsMap();
for (const auto &pair : bwd_outs) { for (const auto &pair : bwd_outs) {
if (!pair.second.IsGrad()) { if (!pair.second.IsGrad()) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册