We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7a0e039 commit 2ea74b9Copy full SHA for 2ea74b9
torch/csrc/jit/passes/create_autodiff_subgraphs.cpp
@@ -88,9 +88,6 @@ class SubgraphSlicer {
88
}
89
curNode = prevNode;
90
91
- // Run CSE one more time to eliminate duplicates that may have occurred
92
- // while re-inlining subgraphs.
93
- EliminateCommonSubexpression(graph_);
94
95
96
private:
@@ -231,6 +228,9 @@ std::vector<Node*> CreateAutodiffSubgraphs(
231
228
size_t threshold) {
232
229
std::vector<Node*> diff_nodes;
233
230
SubgraphSlicer(graph->block(), graph, threshold).run(diff_nodes);
+ // Run CSE to eliminate duplicates that may have occurred
+ // while inlining subgraphs.
+ EliminateCommonSubexpression(graph);
234
return diff_nodes;
235
236
} // namespace jit
0 commit comments