zheng-da commented on a change in pull request #10451: [MXNET-432] Add Foreach URL: https://github.com/apache/incubator-mxnet/pull/10451#discussion_r189734937
########## File path: src/executor/graph_executor.cc ########## @@ -1537,6 +1555,9 @@ GraphExecutor::CachedSegOpr GraphExecutor::CreateCachedSegOpr(size_t topo_start, OpNode& op_node = op_nodes_[nid]; if (op_node.skip_exec_node) continue; if (inode.source->is_variable()) continue; + // We shouldn't add control flow operators to a segment. + // We can't execute these operators in the engine. + if (op_node.exec->HasSubgraph()) continue; Review comment: using `return ret` means breaking the graph into two pieces? ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services