| 66 | } |
| 67 | |
| 68 | const Node* GetVarOfIdentity(const PartitionOptions& opts, |
| 69 | const Node* identity_node) { |
| 70 | for (const Edge* in : identity_node->in_edges()) { |
| 71 | const Node* src = in->src(); |
| 72 | if (src->IsVariable() && |
| 73 | opts.node_to_loc(src) == |
| 74 | opts.node_to_loc(identity_node)) { |
| 75 | // NOTE(jiankeng.pt): Identity has a control edge, |
| 76 | // should consider the other edges. |
| 77 | if (in->IsControlEdge()) continue; |
| 78 | return src; |
| 79 | } |
| 80 | } |
| 81 | return NULL; |
| 82 | } |
| 83 | |
| 84 | void SubGraph::CompleteVariables(const PartitionOptions& opts) { |
| 85 | set<int> var_id_set; |
no test coverage detected