/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ #include "tensorflow/lite/graph_info.h" #include <algorithm> #include <vector> #include "tensorflow/lite/context_util.h" #include "tensorflow/lite/core/c/common.h" namespace tflite { namespace { template <class T> void Uniquefy(std::vector<T>* items) { … } // Helper class that actually performs partitioning by node sub set. // Outputs to a provided `NodeSubset` structure. // // Example usage: // PartitionGraphIntoIndependentNodeSubsetsImpl partitioner( // info, nodes_to_part, control_edges, node_subsets); // partitioner.Partition(); // // NOTE: Changing the partitioning logic would require a change to // FP16GraphPartitionHelper. // LINT.IfChange class PartitionGraphIntoIndependentNodeSubsetsImpl { … }; // LINT.ThenChange(//tensorflow/lite/delegates/utils.h) } // namespace TfLiteStatus PartitionGraphIntoIndependentNodeSubsets( const GraphInfo* info, const TfLiteIntArray* nodes_to_partition, std::vector<NodeSubset>* node_subsets, bool greedily, const ControlEdges* control_edges) { … } } // namespace tflite