#include <stdint.h>
#include <algorithm>
#include <tuple>
#include <utility>
#include "tensorflow/lite/core/c/common.h"
#include "tensorflow/lite/kernels/internal/reference/reference_ops.h"
#include "tensorflow/lite/kernels/internal/tensor.h"
#include "tensorflow/lite/kernels/internal/tensor_ctypes.h"
#include "tensorflow/lite/kernels/kernel_util.h"
#include "tensorflow/lite/string_util.h"
namespace tflite {
namespace ops {
namespace builtin {
namespace tile {
constexpr int kInputTensor = …;
constexpr int kInputMultipliers = …;
constexpr int kOutputTensor = …;
namespace {
struct OpData { … };
template <typename T>
TfLiteIntArray* MultiplyShapeDims(const TfLiteIntArray& shape,
const TfLiteTensor* multipliers,
int num_dimensions) { … }
TfLiteStatus ResizeOutput(TfLiteContext* context, TfLiteNode* node) { … }
template <typename T, typename M>
void CopyMultipleTimes(const T* in_data, int32_t in_size, M multiplier,
T* out_data) { … }
template <typename M>
void CopyStringMultipleTimes(const TfLiteTensor* in_data, int in_data_index,
const int dimension_size, M multiplier,
DynamicBuffer* buffer) { … }
template <typename T, typename M>
std::pair<int, int> TileOneDimension(const TfLiteIntArray& in_dimensions,
const T* in_data, const M* multipliers,
T* out_data, int dimension) { … }
template <typename M>
std::pair<int, int> TileStringOneDimension(
const TfLiteIntArray& in_dimensions, const TfLiteTensor* in_data,
int in_data_index, const M* multipliers, DynamicBuffer* buffer,
int buffer_index, int dimension, TfLiteTensor* out_data) { … }
template <typename T>
void Tile(const TfLiteIntArray& in_dimensions, const TfLiteTensor* in_data,
const TfLiteTensor* multipliers, TfLiteTensor* out_data) { … }
void TileString(const TfLiteIntArray& in_dimensions,
const TfLiteTensor* in_data, const TfLiteTensor* multipliers,
DynamicBuffer* buffer, TfLiteTensor* out_data) { … }
}
TfLiteStatus EvalImpl(TfLiteContext* context, const TfLiteTensor* input,
const TfLiteTensor* multipliers, TfLiteTensor* output) { … }
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) { … }
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { … }
void* Init(TfLiteContext* context, const char* buffer, size_t length) { … }
void Free(TfLiteContext* context, void* buffer) { … }
}
TfLiteRegistration* Register_TILE() { … }
}
}
}