/external/tensorflow/tensorflow/core/grappler/optimizers/ |
D | constant_folding.h | 137 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 …]
|
D | meta_optimizer.cc | 407 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 …]
|
D | common_subgraph_elimination.cc | 168 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 …]
|
D | meta_optimizer.h | 45 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);
|
D | constant_folding.cc | 2033 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 …]
|
D | graph_optimizer.h | 59 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;
|
D | scoped_allocator_optimizer_test.cc | 373 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 …]
|
D | shape_optimizer.cc | 38 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()
|
D | function_optimizer_test.cc | 516 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 …]
|
D | function_optimizer.h | 39 GraphDef* optimized_graph) override; 42 const GraphDef& optimized_graph, double result) override; 53 GraphDef* optimized_graph) const;
|
D | common_subgraph_elimination.h | 50 GraphDef* optimized_graph) override; 53 const GraphDef& optimized_graph, double result) override; 62 Status DedupComputations(GraphDef* optimized_graph);
|
D | loop_optimizer.cc | 61 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 …]
|
D | loop_optimizer.h | 46 GraphDef* optimized_graph) override; 49 const GraphDef& optimized_graph, double result) override; 69 GraphDef* optimized_graph);
|
D | model_pruner.cc | 422 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
|
D | pin_to_host_optimizer.cc | 300 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()
|
D | model_pruner.h | 37 GraphDef* optimized_graph) override; 40 const GraphDef& optimized_graph, double result) override;
|
D | shape_optimizer.h | 43 GraphDef* optimized_graph) override; 46 const GraphDef& optimized_graph, double result) override;
|
D | function_optimizer.cc | 448 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 …]
|
D | remapper.h | 38 GraphDef* optimized_graph) override; 41 const GraphDef& optimized_graph, double result) override;
|
D | pin_to_host_optimizer.h | 51 GraphDef* optimized_graph) override; 54 const GraphDef& optimized_graph, double result) override {} in Feedback() argument
|
/external/tensorflow/tensorflow/core/grappler/optimizers/inference/ |
D | batch_op_rewriter.cc | 79 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()
|
D | batch_op_rewriter_test.cc | 89 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()
|
D | batch_op_rewriter.h | 45 ::tensorflow::GraphDef* optimized_graph) override; 49 const ::tensorflow::GraphDef& optimized_graph, in Feedback()
|
/external/tensorflow/tensorflow/python/grappler/ |
D | tf_optimizer_test.py | 82 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/ |
D | graph_execution_state.cc | 643 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 …]
|