From b9c8c1b185d63587d47355b1e9a11af48476a4ee Mon Sep 17 00:00:00 2001 From: Weilong Wu Date: Wed, 19 Oct 2022 20:43:10 +0800 Subject: [PATCH] [Eager] polish general_grad (#47151) --- paddle/fluid/eager/general_grad.h | 9 --------- 1 file changed, 9 deletions(-) diff --git a/paddle/fluid/eager/general_grad.h b/paddle/fluid/eager/general_grad.h index 3823255de23..27f6a7e609a 100644 --- a/paddle/fluid/eager/general_grad.h +++ b/paddle/fluid/eager/general_grad.h @@ -165,9 +165,6 @@ class GeneralGrad { void GetGraphInfoBetweenTargets(const std::deque& init_queue) { VLOG(6) << "Runing In GetGraphInfoBetweenTargets"; - // Calculate in_degree for each node - std::unordered_map node_in_degree_map; - // Copy nodes std::deque queue = init_queue; std::unordered_set visited; @@ -196,12 +193,6 @@ class GeneralGrad { // Or it could also originated from dispensable inputs if (!next_node) continue; - // Update in_degree - if (!node_in_degree_map.count(next_node)) { - node_in_degree_map[next_node] = 0; - } - node_in_degree_map[next_node]++; - // Record depending relationship (depending_nodes_)[next_node].emplace(node); queue.push_back(next_node); -- GitLab