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

Function CreateRestoreOp

serving/processor/framework/graph_optimizer.cc:804–830  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

802}
803
804Status CreateRestoreOp(const std::string& name,
805 std::vector<SrcInfo>& input_info,
806 std::vector<DataType>& types,
807 Graph* graph, Node** new_node) {
808 NodeDef restore_def;
809 restore_def.set_name(name);
810 restore_def.set_op("RestoreV2");
811 DataTypeVector dtypes;
812 for (auto t : types) {
813 dtypes.push_back(t);
814 }
815 AttrValue attr_value;
816 SetAttrValue(dtypes, &attr_value);
817 (*restore_def.mutable_attr())["dtypes"] = attr_value;
818 Status status;
819 *new_node = graph->AddNode(restore_def, &status);
820 if (!status.ok()) return status;
821
822 // Add input egdes
823 for (size_t i = 0; i < input_info.size(); ++i) {
824 graph->AddEdge(input_info[i].src_node,
825 input_info[i].src_slot,
826 *new_node, i);
827 }
828
829 return Status::OK();
830}
831
832// create 1-D const op, filled by zeros
833Status CreateDefaultValueNode(Graph* graph, int dim_size,

Callers 1

ConvertToHashImportOpMethod · 0.85

Calls 8

set_opMethod · 0.80
SetAttrValueFunction · 0.50
set_nameMethod · 0.45
push_backMethod · 0.45
AddNodeMethod · 0.45
okMethod · 0.45
sizeMethod · 0.45
AddEdgeMethod · 0.45

Tested by

no test coverage detected