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

Method PipelineGraph

tensorflow/core/common_runtime/graph_execution_state.cc:634–653  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

632}
633
634Status 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
655Status GraphExecutionState::InitBaseGraph(std::unique_ptr<Graph>&& new_graph) {
656 // Save stateful placements before placing.

Callers

nothing calls this directly

Calls 6

FindGradientOpsFunction · 0.85
ExtendGraphFunction · 0.85
CopyGraphFunction · 0.50
getMethod · 0.45
swapMethod · 0.45

Tested by

no test coverage detected