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

Function FindSaveOp

tensorflow/core/graph/quantize_training.cc:139–154  ·  view source on GitHub ↗

Find the Save op and inputs.

Source from the content-addressed store, hash-verified

137
138// Find the Save op and inputs.
139Status FindSaveOp(const Graph* graph, Node** save_op,
140 std::vector<const Edge*>* in_edges, bool* found) {
141 *found = false;
142 for (Node* node : graph->op_nodes()) {
143 if (node->type_string() == "SaveV2") {
144 // We found multiple save ops.
145 if (*found) {
146 return errors::InvalidArgument("Input graph has multiple SaveV2 ops.");
147 }
148 *save_op = node;
149 *found = true;
150 TF_RETURN_IF_ERROR(node->input_edges(in_edges));
151 }
152 }
153 return Status::OK();
154}
155
156Node* FindRestoreAllOp(const Graph* graph, StringPiece save_prefix) {
157 for (Node* node : graph->op_nodes()) {

Callers 1

AddSaveAndRestoreFunction · 0.85

Calls 3

InvalidArgumentFunction · 0.85
op_nodesMethod · 0.80
input_edgesMethod · 0.80

Tested by

no test coverage detected