19#include "kernels/Utils.h"
21#include <tensorflow/lite/kernels/internal/reference/binary_function.h>
31 :
Kernel({input, alpha}, {output})
45 switch (
x()->element_type())
47 case DataType::FLOAT32:
51 throw std::runtime_error(
"luci-intp FloorDiv Unsupported type.");
55void FloorDiv::evalFloat()
const
57 auto FloorDivFunc = [](
float x,
float y) ->
float {
58 return std::floor(
static_cast<double>(
x) /
static_cast<double>(
y));
61 const auto x_data = getTensorData<float>(
x());
62 const auto y_data = getTensorData<float>(
y());
70 if (
x()->shape() !=
y()->shape())
72 tflite::reference_ops::BroadcastBinaryFunction4DSlow<float, float, float>(
74 getTensorData<float>(
output()), FloorDivFunc);
78 tflite::reference_ops::BinaryFunction<float, float, float>(
80 getTensorData<float>(
output()), FloorDivFunc);
void resize(const Shape &new_shape)
void execute() const override
void configure() override
FloorDiv(const Tensor *x, const Tensor *y, Tensor *output)
#define LUCI_INTERPRETER_CHECK(cond)
Shape calculateShapeForBroadcast(const Shape &input1_shape, const Shape &input2_shape)
tflite::RuntimeShape getTensorShape(const Tensor *tensor)