| 632 | } |
| 633 | |
| 634 | Status GraphExecutionState::PipelineGraph(std::unique_ptr<Graph>* g, |
| 635 | int32 micro_batch_num) { |
| 636 | Graph* graph = g->get(); |
| 637 | std::unique_ptr<Graph> g2duplicated(new Graph(OpRegistry::Global())); |
| 638 | CopyGraph(*graph, g2duplicated.get()); |
| 639 | |
| 640 | std::unordered_set<const Node*> visited; |
| 641 | if (!FindGradientOps(g2duplicated.get(), visited)) { |
| 642 | return Status::OK(); |
| 643 | } |
| 644 | auto excluded = FindExcludeDuplicationNodes(g2duplicated.get(), visited); |
| 645 | // Duplicate Graph with micro_batch_num-1 duplications |
| 646 | ExtendGraph(g2duplicated.get(), excluded, micro_batch_num - 1); |
| 647 | |
| 648 | std::unique_ptr<Graph> copy(new Graph(graph->flib_def())); |
| 649 | CopyGraph(*(g2duplicated.get()), copy.get()); |
| 650 | g->swap(copy); |
| 651 | |
| 652 | return Status::OK(); |
| 653 | } |
| 654 | |
| 655 | Status GraphExecutionState::InitBaseGraph(std::unique_ptr<Graph>&& new_graph) { |
| 656 | // Save stateful placements before placing. |
nothing calls this directly
no test coverage detected