From e08be61e259b61391b82bbbedce1e367a43cff0c Mon Sep 17 00:00:00 2001 From: jackzhang235 Date: Tue, 10 Mar 2020 13:47:00 +0000 Subject: [PATCH] add some comment for added NodeTopologicalOrder --- lite/core/mir/subgraph/subgraph_detector.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lite/core/mir/subgraph/subgraph_detector.cc b/lite/core/mir/subgraph/subgraph_detector.cc index d7b32e9295..943adc96b4 100644 --- a/lite/core/mir/subgraph/subgraph_detector.cc +++ b/lite/core/mir/subgraph/subgraph_detector.cc @@ -314,6 +314,11 @@ void SubgraphDetector::InitNodes(node_map_t *nodes) { std::vector> SubgraphDetector::ExtractSubgraphs( node_map_t *nodes) { for (auto &n_tpo : graph_->NodeTopologicalOrder()) { + // different orders when traversing nodes in graph may lead to + // different subgraph division, which may generate different result + // with device such as MLU. These different results are all "right" + // but a little confusing. Thus the topological order is used instead + // of the address of the node in graph. CHECK(nodes->find(n_tpo) != nodes->end()); node_dat_t *node = (*nodes)[n_tpo]; if (!node->marked) { -- GitLab