#include <stdint.h>
#include <algorithm>
#include <iterator>
#include <vector>
#include "tensorflow/lite/core/c/c_api_types.h"
#include "tensorflow/lite/core/c/common.h"
#include "tensorflow/lite/kernels/internal/compatibility.h"
#include "tensorflow/lite/kernels/internal/tensor.h"
#include "tensorflow/lite/kernels/internal/tensor_ctypes.h"
#include "tensorflow/lite/kernels/kernel_util.h"
namespace tflite {
namespace ops {
namespace builtin {
namespace topk_v2 {
constexpr int kInputTensor = …;
constexpr int kInputTopK = …;
constexpr int kOutputValues = …;
constexpr int kOutputIndexes = …;
namespace {
TfLiteStatus ResizeOutput(TfLiteContext* context, TfLiteNode* node) { … }
template <typename T, typename Tidx>
class TopContainer { … };
template <typename T, typename Tidx = int32>
void TopK(int32 row_size, int32 num_rows, const T* data, int32 k,
Tidx* output_indexes, T* output_values) { … }
}
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) { … }
template <typename idx_type>
TfLiteStatus TopKImpl(TfLiteContext* context, TfLiteNode* node, int32_t k,
idx_type* output_indexes) { … }
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { … }
}
TfLiteRegistration* Register_TOPK_V2() { … }
}
}
}