MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / CreateRestoreAllNode

Function CreateRestoreAllNode

serving/processor/framework/graph_optimizer.cc:902–927  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

900}
901
902Status 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
929Status FindGatherNode(Node* n, const std::unordered_set<std::string>& stop_nodes,
930 Node** gather_node) {

Callers 3

AddIncrRestoreOpsMethod · 0.85

Calls 7

set_opMethod · 0.80
set_nameMethod · 0.45
AddNodeMethod · 0.45
okMethod · 0.45
sizeMethod · 0.45
DebugStringMethod · 0.45
AddEdgeMethod · 0.45

Tested by

no test coverage detected