/external/tensorflow/tensorflow/core/grappler/optimizers/ |
D | constant_folding.h | 134 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 …]
|
D | common_subgraph_elimination.cc | 174 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 …]
|
D | meta_optimizer.cc | 748 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 …]
|
D | constant_folding.cc | 1633 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 …]
|
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); 96 Cluster* cluster, GrapplerItem&& item, GraphDef* optimized_graph); 98 GraphDef* optimized_graph); 118 GrapplerItem* optimized_item, GraphDef* optimized_graph, 134 GraphDef* optimized_graph);
|
D | scoped_allocator_optimizer_test.cc | 374 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 …]
|
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 | 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 | graph_optimizer.h | 59 GraphDef* optimized_graph) = 0; 63 GraphDef* optimized_graph) { in Optimize() argument 64 return Optimize(cluster, item, optimized_graph); in Optimize()
|
D | tfg_optimizer_hook.cc | 112 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()
|
D | pin_to_host_optimizer.cc | 299 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()
|
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()
|
D | function_optimizer.cc | 451 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 …]
|
D | function_optimizer.h | 39 GraphDef* optimized_graph) override; 50 GraphDef* optimized_graph) const;
|
D | common_subgraph_elimination.h | 50 GraphDef* optimized_graph) override; 59 Status DedupComputations(GraphDef* optimized_graph);
|
D | implementation_selector.cc | 398 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()
|
D | graph_optimizer_stage.h | 50 GraphDef* optimized_graph, in GraphOptimizerContext() 55 optimized_graph(optimized_graph), in GraphOptimizerContext() 62 GraphDef* optimized_graph; member
|
D | loop_optimizer.h | 46 GraphDef* optimized_graph) override; 66 GraphDef* optimized_graph);
|
D | custom_graph_optimizer_registry_test.cc | 43 GraphDef* optimized_graph) override { in Optimize() argument 97 GraphDef* optimized_graph) override { in Optimize() argument
|
/external/tensorflow/tensorflow/core/grappler/optimizers/inference/ |
D | batch_op_rewriter.cc | 125 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()
|
D | batch_op_rewriter_test.cc | 102 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/ |
D | graph_execution_state.cc | 648 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/ |
D | tf_optimizer_test.py | 79 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/ |
D | tfrt_graph_execution_state.cc | 796 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()
|