Adds new variables to save and restore ops matching the Save and Restore graphs created in tensorflow/python/training/saver.py.
| 315 | // Adds new variables to save and restore ops matching the Save and Restore |
| 316 | // graphs created in tensorflow/python/training/saver.py. |
| 317 | Status 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. |
no test coverage detected