#include "tensorflow/lite/delegates/utils.h"
#include <algorithm>
#include <cstdint>
#include <cstring>
#include <set>
#include <string>
#include <vector>
#include "tensorflow/lite/builtin_ops.h"
#include "tensorflow/lite/c/c_api_types.h"
#include "tensorflow/lite/c/common.h"
#include "tensorflow/lite/context_util.h"
#include "tensorflow/lite/core/subgraph.h"
#include "tensorflow/lite/kernels/kernel_util.h"
#include "tensorflow/lite/util.h"
namespace tflite {
namespace delegates {
TfLiteStatus CreateNewTensorWithDifferentType(TfLiteContext* context,
const int original_tensor_index,
TfLiteType new_type,
TfLiteTensor** new_tensor,
int* new_tensor_index) { … }
TfLiteStatus AcquireSubgraphContext(const struct TfLiteContext* context,
int subgraph_index,
TfLiteContext** acquired_context) { … }
TfLiteStatus ReleaseSubgraphContext(const struct TfLiteContext* context,
int subgraph_index) { … }
TfLiteStatus MarkSubgraphAsDelegationSkippable(const TfLiteContext* context,
int subgraph_index) { … }
TfLiteStatus GraphPartitionHelper::PartitionImpl(
std::set<std::string>* unsupported_nodes_info, int start_node_index,
int end_node_index) { … }
std::vector<TfLiteDelegateParams*>
GraphPartitionHelper::GetFirstNLargestPartitions(
int n, int min_nodes_per_partition) const { … }
std::vector<int> GraphPartitionHelper::GetNodesOfFirstNLargestPartitionsImpl(
int n, int min_nodes_per_partition) { … }
TfLiteStatus GraphPartitionHelper::PrepareSupportedNodes(
std::set<std::string>* unsupported_nodes_info, int start_node_index,
int end_node_index) { … }
std::vector<int>
FP16GraphPartitionHelper::GetNodesOfFirstNLargestPartitionsImpl(
int n, int min_nodes_per_partition) { … }
bool FP16GraphPartitionHelper::IsNodeSupported(
TfLiteContext* context, TfLiteNode* node, TfLiteRegistration* registration,
int node_id, std::string* unsupported_details) { … }
void FP16GraphPartitionHelper::RemapFp16InputTensors(
const std::vector<int>& nodes) const { … }
void FP16GraphPartitionHelper::RemapFp16InputTensors(
TfLiteNode* node, std::vector<int>* orig_inputs) const { … }
}
}