Home
last modified time | relevance | path

Searched refs:optimized_graph (Results 1 – 25 of 67) sorted by relevance

123

/external/tensorflow/tensorflow/core/grappler/optimizers/
Dconstant_folding.h134 Status SimplifyGraph(GraphDef* optimized_graph, GraphProperties* properties,
136 Status SimplifyNode(NodeDef* node, GraphDef* optimized_graph,
141 GraphDef* optimized_graph);
145 bool PartialConcatConstFolding(GraphDef* optimized_graph,
150 bool PartialAssocOpConstFolding(GraphDef* optimized_graph,
192 bool ConstantPushDown(GraphProperties* properties, GraphDef* optimized_graph,
198 GraphDef* optimized_graph, NodeDef* node);
202 bool MulConvPushDown(GraphDef* optimized_graph, NodeDef* node,
207 bool ReduceDivToReciprocalMul(GraphDef* optimized_graph, NodeDef* node);
214 GraphDef* optimized_graph, NodeDef* node);
[all …]
Dcommon_subgraph_elimination.cc174 Status CommonSubgraphElimination::DedupComputations(GraphDef* optimized_graph) { in DedupComputations() argument
175 CanonicalizeGraph(optimized_graph); in DedupComputations()
178 if (!graph_view.InitializeFromGraph(*optimized_graph).ok()) { in DedupComputations()
188 for (int i = 0; i < optimized_graph->node_size(); ++i) { in DedupComputations()
189 const NodeDef& root = optimized_graph->node(i); in DedupComputations()
204 std::vector<bool> can_dedup(optimized_graph->node_size()); in DedupComputations()
205 for (int i = 0; i < optimized_graph->node_size(); ++i) { in DedupComputations()
206 const NodeDef& node = optimized_graph->node(i); in DedupComputations()
214 NodeMap node_map(optimized_graph); in DedupComputations()
217 for (int i = 0; i < optimized_graph->node_size(); ++i) { in DedupComputations()
[all …]
Dmeta_optimizer.cc748 Cluster* cluster, GrapplerItem&& item, GraphDef* optimized_graph) { in OptimizeGraph() argument
754 *optimized_graph = item.graph; in OptimizeGraph()
785 *optimized_graph = item.graph; in OptimizeGraph()
792 *optimized_graph = std::move(item.graph); in OptimizeGraph()
802 CompressConstants(optimized_graph); in OptimizeGraph()
807 if (optimized_graph->node_size() < min_graph_nodes) { in OptimizeGraph()
809 << ", graph is tiny (#nodes = " << optimized_graph->node_size() in OptimizeGraph()
818 reinterpret_cast<uintptr_t>(optimized_graph)), in OptimizeGraph()
819 *optimized_graph); in OptimizeGraph()
835 optimized_graph, &optimization_result)); in OptimizeGraph()
[all …]
Dconstant_folding.cc1633 const GraphProperties& properties, GraphDef* optimized_graph, in FoldGraph() argument
1657 Status s = FoldNode(node, optimized_graph, &result_too_large); in FoldGraph()
1677 for (int i = 0; i < optimized_graph->node_size(); i++) { in FoldGraph()
1678 const auto& fanout = node_map_->GetOutputs(optimized_graph->node(i).name()); in FoldGraph()
1681 EraseNodesFromGraph(std::move(nodes_to_delete), optimized_graph); in FoldGraph()
1691 *(optimized_graph->add_node()) = std::move(*node); in FoldGraph()
2082 GraphDef* optimized_graph, GraphProperties* properties, in SimplifyGraph() argument
2084 for (int i = 0; i < optimized_graph->node_size(); ++i) { in SimplifyGraph()
2085 NodeDef* node = optimized_graph->mutable_node(i); in SimplifyGraph()
2095 TF_RETURN_IF_ERROR(SimplifyNode(node, optimized_graph, properties)); in SimplifyGraph()
[all …]
Dmeta_optimizer.h45 GraphDef* optimized_graph) override { in Optimize() argument
47 return OptimizeConsumeItem(cluster, std::move(copy), optimized_graph); in Optimize()
51 GraphDef* optimized_graph);
96 Cluster* cluster, GrapplerItem&& item, GraphDef* optimized_graph);
98 GraphDef* optimized_graph);
118 GrapplerItem* optimized_item, GraphDef* optimized_graph,
134 GraphDef* optimized_graph);
Dscoped_allocator_optimizer_test.cc374 GraphDef optimized_graph; in TEST_F() local
375 TF_ASSERT_OK(sao.Optimize(nullptr /*cluster*/, item, &optimized_graph)); in TEST_F()
378 NodeMap node_map(&optimized_graph); in TEST_F()
493 GraphDef optimized_graph; in TEST_F() local
494 TF_ASSERT_OK(sao.Optimize(/*cluster=*/nullptr, item, &optimized_graph)); in TEST_F()
495 NodeMap node_map(&optimized_graph); in TEST_F()
500 ValidateSAControlInput(&optimized_graph, &node_map, "a"); in TEST_F()
502 EXPECT_TRUE(ValidateSAControlInput(&optimized_graph, &node_map, "b")); in TEST_F()
503 EXPECT_TRUE(ValidateSAControlInput(&optimized_graph, &node_map, "s1")); in TEST_F()
525 GraphDef optimized_graph; in TEST_F() local
[all …]
Dshape_optimizer.cc38 GraphDef* optimized_graph) { in Optimize() argument
68 *optimized_graph = item.graph; in Optimize()
72 MutableGraphView graph(optimized_graph); in Optimize()
75 for (auto& node : *optimized_graph->mutable_node()) { in Optimize()
142 MutableGraphView graph(optimized_graph); in Optimize()
143 for (auto& node : *optimized_graph->mutable_node()) { in Optimize()
Dfunction_optimizer_test.cc516 GraphDef optimized_graph; in TEST_F() local
517 TF_EXPECT_OK(optimizer.Optimize(nullptr, item, &optimized_graph)); in TEST_F()
538 CompareGraphs(expected, optimized_graph); in TEST_F()
540 GrapplerItem optimized = item.WithGraph(std::move(optimized_graph)); in TEST_F()
550 GraphDef optimized_graph; in TEST_F() local
552 TF_EXPECT_OK(optimizer.Optimize(nullptr, item, &optimized_graph)); in TEST_F()
567 CompareGraphs(expected, optimized_graph); in TEST_F()
569 GrapplerItem optimized = item.WithGraph(std::move(optimized_graph)); in TEST_F()
643 GraphDef optimized_graph; in TEST_F() local
644 TF_EXPECT_OK(optimizer.Optimize(nullptr, item, &optimized_graph)); in TEST_F()
[all …]
Dloop_optimizer.cc61 explicit LoopInvariantNodeMotionOptimizer(GraphDef* optimized_graph) in LoopInvariantNodeMotionOptimizer() argument
62 : optimized_graph_(optimized_graph) {} in LoopInvariantNodeMotionOptimizer()
519 GraphDef* optimized_graph) { in RemoveStackOps() argument
520 NodeMap node_map(optimized_graph); in RemoveStackOps()
522 TF_RETURN_IF_ERROR(graph_view.InitializeFromGraph(*optimized_graph)); in RemoveStackOps()
524 for (int node_idx = 0; node_idx < optimized_graph->node_size(); ++node_idx) { in RemoveStackOps()
525 if (IsStackOp(optimized_graph->node(node_idx))) { in RemoveStackOps()
531 NodeDef* push_node = optimized_graph->mutable_node(push_node_idx); in RemoveStackOps()
540 push_node->input(1), optimized_graph, &node_map); in RemoveStackOps()
733 GraphDef* optimized_graph) { in Optimize() argument
[all …]
Dgraph_optimizer.h59 GraphDef* optimized_graph) = 0;
63 GraphDef* optimized_graph) { in Optimize() argument
64 return Optimize(cluster, item, optimized_graph); in Optimize()
Dtfg_optimizer_hook.cc112 tensorflow::GraphDef* optimized_graph) { in Optimize() argument
160 *optimized_graph = std::move(graphdef); in Optimize()
166 *optimized_graph); in Optimize()
170 << optimized_graph->DebugString() << "\nMLIR module: \n"; in Optimize()
Dpin_to_host_optimizer.cc299 GraphDef* optimized_graph) { in Optimize() argument
300 *optimized_graph = item.graph; in Optimize()
303 if (IsLegacyTPUBridgeGraphDef(*optimized_graph)) { in Optimize()
308 GraphView graph(optimized_graph); in Optimize()
322 TF_RETURN_IF_ERROR(TopologicalSort(optimized_graph)); in Optimize()
327 for (auto& node : *optimized_graph->mutable_node()) { in Optimize()
Dmodel_pruner.cc422 GraphDef* optimized_graph) { in Optimize() argument
502 optimized_graph->Clear(); in Optimize()
503 *optimized_graph->mutable_library() = item.graph.library(); in Optimize()
504 *optimized_graph->mutable_versions() = item.graph.versions(); in Optimize()
506 optimized_graph->mutable_node()->Swap(pruned_graph->mutable_node()); in Optimize()
512 optimized_graph->mutable_node()->Reserve(pruned_graph->node_size()); in Optimize()
516 NodeDef* new_node = optimized_graph->add_node(); in Optimize()
525 << optimized_graph->node_size() << " nodes."; in Optimize()
526 if (optimized_graph->node_size() > item.graph.node_size()) { in Optimize()
Dfunction_optimizer.cc451 const GraphDef& optimized_graph) { in PruneFunctionLibrary() argument
453 flib.ReachableDefinitions(optimized_graph); in PruneFunctionLibrary()
685 GraphDef* optimized_graph) { in SpecializeFunction() argument
705 NodeDef* specialized_func_node = optimized_graph->add_node(); in SpecializeFunction()
767 NodeDef* specialized_func_node = optimized_graph->add_node(); in SpecializeFunction()
1412 GraphDef* optimized_graph) { in RestoreTensorMapping() argument
1425 for (NodeDef& node : *optimized_graph->mutable_node()) { in RestoreTensorMapping()
1441 const GrapplerItem& item, GraphDef* optimized_graph) const { in RunFunctionOptimizerPass()
1456 const int num_nodes_before = optimized_graph->node_size(); in RunFunctionOptimizerPass()
1458 int num_nodes = optimized_graph->node_size(); in RunFunctionOptimizerPass()
[all …]
Dfunction_optimizer.h39 GraphDef* optimized_graph) override;
50 GraphDef* optimized_graph) const;
Dcommon_subgraph_elimination.h50 GraphDef* optimized_graph) override;
59 Status DedupComputations(GraphDef* optimized_graph);
Dimplementation_selector.cc398 GraphDef* optimized_graph) { in Optimize() argument
410 *optimized_graph = item.graph; in Optimize()
411 status = SelectDeviceIndex(optimized_graph); in Optimize()
413 *optimized_graph = item.graph; in Optimize()
416 return SelectImplementation(optimized_graph); in Optimize()
Dgraph_optimizer_stage.h50 GraphDef* optimized_graph, in GraphOptimizerContext()
55 optimized_graph(optimized_graph), in GraphOptimizerContext()
62 GraphDef* optimized_graph; member
Dloop_optimizer.h46 GraphDef* optimized_graph) override;
66 GraphDef* optimized_graph);
Dcustom_graph_optimizer_registry_test.cc43 GraphDef* optimized_graph) override { in Optimize() argument
97 GraphDef* optimized_graph) override { in Optimize() argument
/external/tensorflow/tensorflow/core/grappler/optimizers/inference/
Dbatch_op_rewriter.cc125 GraphDef* optimized_graph) { in Optimize() argument
127 *optimized_graph = item.graph; in Optimize()
158 for (int i = 0; i < optimized_graph->node_size(); ++i) { in Optimize()
159 NodeDef* node = optimized_graph->mutable_node(i); in Optimize()
164 for (int i = 0; i < optimized_graph->library().function_size(); i++) { in Optimize()
166 optimized_graph->mutable_library()->mutable_function(i); in Optimize()
187 for (int i = 0; i < optimized_graph->node_size(); ++i) { in Optimize()
188 NodeDef* node = optimized_graph->mutable_node(i); in Optimize()
195 for (int i = 0; i < optimized_graph->library().function_size(); i++) { in Optimize()
197 optimized_graph->mutable_library()->mutable_function(i); in Optimize()
Dbatch_op_rewriter_test.cc102 GraphDef optimized_graph; in TEST_P() local
103 TF_ASSERT_OK(optimizer.Optimize(nullptr, item, &optimized_graph)); in TEST_P()
109 EXPECT_EQ(optimized_graph.DebugString(), expected_graph.DebugString()); in TEST_P()
142 GraphDef optimized_graph; in TEST_P() local
143 Status status = optimizer.Optimize(nullptr, item, &optimized_graph); in TEST_P()
178 GraphDef optimized_graph; in TEST_P() local
181 TF_ASSERT_OK(optimizer.Optimize(nullptr, item, &optimized_graph)); in TEST_P()
197 EXPECT_EQ(optimized_graph.DebugString(), expected_graph.DebugString()); in TEST_P()
/external/tensorflow/tensorflow/core/common_runtime/
Dgraph_execution_state.cc648 std::unique_ptr<Graph>* optimized_graph, in OptimizeGraph() argument
831 optimized_graph->reset(new Graph(OpRegistry::Global())); in OptimizeGraph()
837 optimized_graph->get())); in OptimizeGraph()
842 for (Node* node : optimized_graph->get()->nodes()) { in OptimizeGraph()
865 std::unique_ptr<Graph> optimized_graph; in BuildGraph() local
868 Status s = OptimizeGraph(options, *graph_, flib_def_.get(), &optimized_graph, in BuildGraph()
874 optimized_graph.reset(new Graph(flib_def_.get())); in BuildGraph()
875 CopyGraph(*graph_, optimized_graph.get()); in BuildGraph()
883 PruneGraph(options, optimized_graph.get(), &rewrite_metadata)); in BuildGraph()
900 optimization_options.graph = &optimized_graph; in BuildGraph()
[all …]
/external/tensorflow/tensorflow/python/grappler/
Dtf_optimizer_test.py79 optimized_graph = tf_optimizer.OptimizeGraph(config, mg)
82 optimized_graph_nodes = [node.name for node in optimized_graph.node]
124 optimized_graph = tf_optimizer.OptimizeGraph(config, mg)
125 mg.graph_def.CopyFrom(optimized_graph)
/external/tensorflow/tensorflow/core/tfrt/utils/
Dtfrt_graph_execution_state.cc796 std::unique_ptr<tensorflow::Graph> optimized_graph; in OptimizeFunctions() local
814 &optimized_graph, &optimized_flib); in OptimizeFunctions()
823 optimized_graph->AddFunctionLibrary(optimized_flib->ToProto())); in OptimizeFunctions()
829 TF_RETURN_IF_ERROR(GraphToFunctionDef(*optimized_graph, in OptimizeFunctions()
843 std::unique_ptr<tensorflow::Graph> optimized_graph; in OptimizeGraph() local
850 build_graph_options, graph, &graph.flib_def(), &optimized_graph, in OptimizeGraph()
862 optimized_graph->mutable_flib_def()->Clear(); in OptimizeGraph()
865 TF_RETURN_IF_ERROR(optimized_graph->AddFunctionLibrary(optimized_flib_proto)); in OptimizeGraph()
867 return optimized_graph; in OptimizeGraph()

123