| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| #include "edge-impulse-sdk/tensorflow/lite/kernels/internal/reference/floor.h" |
|
|
| #include "edge-impulse-sdk/tensorflow/lite/c/common.h" |
| #include "edge-impulse-sdk/tensorflow/lite/kernels/internal/tensor_ctypes.h" |
| #include "edge-impulse-sdk/tensorflow/lite/micro/kernels/kernel_util.h" |
|
|
| namespace tflite { |
|
|
| namespace { |
|
|
| constexpr int kInputTensor = 0; |
| constexpr int kOutputTensor = 0; |
|
|
| TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { |
| const TfLiteEvalTensor* input = |
| tflite::micro::GetEvalInput(context, node, kInputTensor); |
| TF_LITE_ENSURE_TYPES_EQ(context, input->type, kTfLiteFloat32); |
| TfLiteEvalTensor* output = |
| tflite::micro::GetEvalOutput(context, node, kOutputTensor); |
| reference_ops::Floor(tflite::micro::GetTensorShape(input), |
| tflite::micro::GetTensorData<float>(input), |
| tflite::micro::GetTensorShape(output), |
| tflite::micro::GetTensorData<float>(output)); |
| return kTfLiteOk; |
| } |
|
|
| } |
|
|
| TfLiteRegistration Register_FLOOR() { |
| return tflite::micro::RegisterOp(nullptr, nullptr, Eval); |
| } |
|
|
| } |
|
|