Home
last modified time | relevance | path

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

123

/external/tensorflow/tensorflow/core/grappler/optimizers/
Dconstant_folding.h137 Status SimplifyGraph(bool use_shape_info, GraphDef* optimized_graph,
141 GraphDef* optimized_graph, GraphProperties* properties);
144 GraphDef* optimized_graph);
148 bool PartialConcatConstFolding(GraphDef* optimized_graph,
153 bool PartialAssocOpConstFolding(GraphDef* optimized_graph,
195 bool ConstantPushDown(GraphProperties* properties, GraphDef* optimized_graph,
201 GraphDef* optimized_graph, NodeDef* node);
205 bool MulConvPushDown(GraphDef* optimized_graph, NodeDef* node,
210 bool ReduceDivToReciprocalMul(GraphDef* optimized_graph, NodeDef* node);
217 GraphDef* optimized_graph, NodeDef* node);
[all …]
Dmeta_optimizer.cc407 GraphDef* optimized_graph) { in OptimizeGraph() argument
413 *optimized_graph = item.graph; in OptimizeGraph()
449 *optimized_graph = item.graph; in OptimizeGraph()
456 optimized_graph->Swap(&item.graph); in OptimizeGraph()
464 CompressConstants(optimized_graph); in OptimizeGraph()
469 if (optimized_graph->node_size() < min_graph_nodes) { in OptimizeGraph()
471 << ", graph is tiny (#nodes = " << optimized_graph->node_size() in OptimizeGraph()
480 reinterpret_cast<uintptr_t>(optimized_graph)), in OptimizeGraph()
481 *optimized_graph); in OptimizeGraph()
495 optimized_graph, &optimization_result)); in OptimizeGraph()
[all …]
Dcommon_subgraph_elimination.cc168 Status CommonSubgraphElimination::DedupComputations(GraphDef* optimized_graph) { in DedupComputations() argument
169 CanonicalizeGraph(optimized_graph); in DedupComputations()
172 if (!graph_view.InitializeFromGraph(*optimized_graph).ok()) { in DedupComputations()
182 for (int i = 0; i < optimized_graph->node_size(); ++i) { in DedupComputations()
183 const NodeDef& root = optimized_graph->node(i); in DedupComputations()
198 std::vector<bool> can_dedup(optimized_graph->node_size()); in DedupComputations()
199 for (int i = 0; i < optimized_graph->node_size(); ++i) { in DedupComputations()
200 const NodeDef& node = optimized_graph->node(i); in DedupComputations()
208 NodeMap node_map(optimized_graph); in DedupComputations()
211 for (int i = 0; i < optimized_graph->node_size(); ++i) { in DedupComputations()
[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);
58 const GraphDef& optimized_graph, double result) override {} in Feedback() argument
90 GraphDef* optimized_graph);
109 GrapplerItem* optimized_item, GraphDef* optimized_graph,
125 GraphDef* optimized_graph);
Dconstant_folding.cc2033 bool use_shape_info, GraphDef* optimized_graph, GraphProperties* properties, in SimplifyGraph() argument
2035 for (int i = 0; i < optimized_graph->node_size(); ++i) { in SimplifyGraph()
2036 NodeDef* node = optimized_graph->mutable_node(i); in SimplifyGraph()
2047 SimplifyNode(use_shape_info, node, optimized_graph, properties)); in SimplifyGraph()
2066 GraphDef* optimized_graph, in SimplifyNode() argument
2071 RETURN_IF_MODIFIED(RemoveSplitOrSplitV(*properties, optimized_graph, node)); in SimplifyNode()
2073 *properties, use_shape_info, optimized_graph, node)); in SimplifyNode()
2075 RemoveRandomShuffle(*properties, use_shape_info, optimized_graph, node)); in SimplifyNode()
2077 RemoveReverse(*properties, use_shape_info, optimized_graph, node)); in SimplifyNode()
2079 SimplifySlice(*properties, use_shape_info, optimized_graph, node)); in SimplifyNode()
[all …]
Dgraph_optimizer.h59 GraphDef* optimized_graph) = 0;
63 GraphDef* optimized_graph) { in Optimize() argument
64 return Optimize(cluster, item, optimized_graph); in Optimize()
71 const GraphDef& optimized_graph, double result) = 0;
Dscoped_allocator_optimizer_test.cc373 GraphDef optimized_graph; in TEST_F() local
374 TF_ASSERT_OK(sao.Optimize(nullptr /*cluster*/, item, &optimized_graph)); in TEST_F()
377 NodeMap node_map(&optimized_graph); in TEST_F()
492 GraphDef optimized_graph; in TEST_F() local
493 TF_ASSERT_OK(sao.Optimize(/*cluster=*/nullptr, item, &optimized_graph)); in TEST_F()
494 NodeMap node_map(&optimized_graph); in TEST_F()
499 ValidateSAControlInput(&optimized_graph, &node_map, "a"); in TEST_F()
501 EXPECT_TRUE(ValidateSAControlInput(&optimized_graph, &node_map, "b")); in TEST_F()
502 EXPECT_TRUE(ValidateSAControlInput(&optimized_graph, &node_map, "s1")); in TEST_F()
524 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 …]
Dfunction_optimizer.h39 GraphDef* optimized_graph) override;
42 const GraphDef& optimized_graph, double result) override;
53 GraphDef* optimized_graph) const;
Dcommon_subgraph_elimination.h50 GraphDef* optimized_graph) override;
53 const GraphDef& optimized_graph, double result) override;
62 Status DedupComputations(GraphDef* optimized_graph);
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 …]
Dloop_optimizer.h46 GraphDef* optimized_graph) override;
49 const GraphDef& optimized_graph, double result) override;
69 GraphDef* optimized_graph);
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()
533 const GraphDef& optimized_graph, double result) { in Feedback() argument
Dpin_to_host_optimizer.cc300 GraphDef* optimized_graph) { in Optimize() argument
301 *optimized_graph = item.graph; in Optimize()
304 if (IsTPUGraphDef(*optimized_graph)) { in Optimize()
309 GraphView graph(optimized_graph); in Optimize()
323 TF_RETURN_IF_ERROR(TopologicalSort(optimized_graph)); in Optimize()
328 for (auto& node : *optimized_graph->mutable_node()) { in Optimize()
Dmodel_pruner.h37 GraphDef* optimized_graph) override;
40 const GraphDef& optimized_graph, double result) override;
Dshape_optimizer.h43 GraphDef* optimized_graph) override;
46 const GraphDef& optimized_graph, double result) override;
Dfunction_optimizer.cc448 const GraphDef& optimized_graph) { in PruneFunctionLibrary() argument
450 flib.ReachableDefinitions(optimized_graph); in PruneFunctionLibrary()
682 GraphDef* optimized_graph) { in SpecializeFunction() argument
702 NodeDef* specialized_func_node = optimized_graph->add_node(); in SpecializeFunction()
764 NodeDef* specialized_func_node = optimized_graph->add_node(); in SpecializeFunction()
1402 GraphDef* optimized_graph) { in RestoreTensorMapping() argument
1415 for (NodeDef& node : *optimized_graph->mutable_node()) { in RestoreTensorMapping()
1431 const GrapplerItem& item, GraphDef* optimized_graph) const { in RunFunctionOptimizerPass()
1446 const int num_nodes_before = optimized_graph->node_size(); in RunFunctionOptimizerPass()
1448 int num_nodes = optimized_graph->node_size(); in RunFunctionOptimizerPass()
[all …]
Dremapper.h38 GraphDef* optimized_graph) override;
41 const GraphDef& optimized_graph, double result) override;
Dpin_to_host_optimizer.h51 GraphDef* optimized_graph) override;
54 const GraphDef& optimized_graph, double result) override {} in Feedback() argument
/external/tensorflow/tensorflow/core/grappler/optimizers/inference/
Dbatch_op_rewriter.cc79 GraphDef* optimized_graph) { in Optimize() argument
81 *optimized_graph = item.graph; in Optimize()
89 for (int i = 0; i < optimized_graph->node_size(); ++i) { in Optimize()
90 NodeDef* node = optimized_graph->mutable_node(i); in Optimize()
97 for (int i = 0; i < optimized_graph->library().function_size(); i++) { in Optimize()
99 optimized_graph->mutable_library()->mutable_function(i); in Optimize()
Dbatch_op_rewriter_test.cc89 GraphDef optimized_graph; in TEST_P() local
90 TF_ASSERT_OK(optimizer.Optimize(nullptr, item, &optimized_graph)); in TEST_P()
96 EXPECT_EQ(optimized_graph.DebugString(), expected_graph.DebugString()); in TEST_P()
Dbatch_op_rewriter.h45 ::tensorflow::GraphDef* optimized_graph) override;
49 const ::tensorflow::GraphDef& optimized_graph, in Feedback()
/external/tensorflow/tensorflow/python/grappler/
Dtf_optimizer_test.py82 optimized_graph = tf_optimizer.OptimizeGraph(config, mg)
85 optimized_graph_nodes = [node.name for node in optimized_graph.node]
127 optimized_graph = tf_optimizer.OptimizeGraph(config, mg)
128 mg.graph_def.CopyFrom(optimized_graph)
/external/tensorflow/tensorflow/core/common_runtime/
Dgraph_execution_state.cc643 const BuildGraphOptions& options, std::unique_ptr<Graph>* optimized_graph, in OptimizeGraph() argument
826 optimized_graph->reset(new Graph(OpRegistry::Global())); in OptimizeGraph()
832 optimized_graph->get())); in OptimizeGraph()
837 for (Node* node : optimized_graph->get()->nodes()) { in OptimizeGraph()
860 std::unique_ptr<Graph> optimized_graph; in BuildGraph() local
863 Status s = OptimizeGraph(options, &optimized_graph, &optimized_flib); in BuildGraph()
868 optimized_graph.reset(new Graph(flib_def_.get())); in BuildGraph()
869 CopyGraph(*graph_, optimized_graph.get()); in BuildGraph()
877 PruneGraph(options, optimized_graph.get(), &rewrite_metadata)); in BuildGraph()
894 optimization_options.graph = &optimized_graph; in BuildGraph()
[all …]

123