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

Function AddSaveAndRestore

tensorflow/core/graph/quantize_training.cc:317–329  ·  view source on GitHub ↗

Adds new variables to save and restore ops matching the Save and Restore graphs created in tensorflow/python/training/saver.py.

Source from the content-addressed store, hash-verified

315// Adds new variables to save and restore ops matching the Save and Restore
316// graphs created in tensorflow/python/training/saver.py.
317Status AddSaveAndRestore(Graph* graph, const std::vector<Node*>& variables) {
318 Node* save_op = nullptr;
319 std::vector<const Edge*> in_edges;
320 bool found = false;
321 TF_RETURN_IF_ERROR(FindSaveOp(graph, &save_op, &in_edges, &found));
322 if (found) {
323 TF_RETURN_IF_ERROR(
324 AddRestoreVariableSubgraphs(graph, save_op, in_edges, variables));
325 TF_RETURN_IF_ERROR(
326 ConnectVariablesToSaveOp(graph, save_op, in_edges, variables));
327 }
328 return Status::OK();
329}
330
331// Sets output to the Node that computes reduction axes corresponding to all
332// dimensions of input and return.

Callers 1

ProcessTargetEdgesFunction · 0.85

Calls 3

FindSaveOpFunction · 0.85
ConnectVariablesToSaveOpFunction · 0.85

Tested by

no test coverage detected