| 900 | } |
| 901 | |
| 902 | Status CreateRestoreAllNode(const std::string& name, |
| 903 | const std::string& op_name, |
| 904 | std::vector<SrcInfo>& inputs, |
| 905 | Graph* graph) { |
| 906 | NodeDef def; |
| 907 | def.set_name(name); |
| 908 | def.set_op(op_name); |
| 909 | Status status; |
| 910 | Node *new_node = graph->AddNode(def, &status); |
| 911 | if (!status.ok()) return status; |
| 912 | |
| 913 | // Add input egdes |
| 914 | int dst_in_slot = Graph::kControlSlot; |
| 915 | for (size_t i = 0; i < inputs.size(); ++i) { |
| 916 | if (inputs[i].src_slot != Graph::kControlSlot) { |
| 917 | LOG(FATAL) << "RestoreAll op only allow control eages. " |
| 918 | << "Current input node: " << inputs[i].src_node->DebugString() |
| 919 | << ", slot: " << inputs[i].src_slot; |
| 920 | } |
| 921 | |
| 922 | graph->AddEdge(inputs[i].src_node, inputs[i].src_slot, |
| 923 | new_node, dst_in_slot); |
| 924 | } |
| 925 | |
| 926 | return Status::OK(); |
| 927 | } |
| 928 | |
| 929 | Status FindGatherNode(Node* n, const std::unordered_set<std::string>& stop_nodes, |
| 930 | Node** gather_node) { |
no test coverage detected