提交 e08be61e 编写于 作者: J jackzhang235

add some comment for added NodeTopologicalOrder

上级 809f7fc3
......@@ -314,6 +314,11 @@ void SubgraphDetector::InitNodes(node_map_t *nodes) {
std::vector<std::vector<Node *>> 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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册