19#include "kernels/Utils.h"
21#include <tensorflow/lite/kernels/internal/reference/leaky_relu.h>
23#include "PALLeakyRelu.h"
41 if (
input()->element_type() == DataType::U8)
46 quantizeMultiplier(identity_multiplier, &_output_multiplier_identity, &_output_shift_identity);
53 switch (
input()->element_type())
55 case DataType::FLOAT32:
62 throw std::runtime_error(
"luci-intp LeakyRelu Unsupported type.");
66void LeakyRelu::evalFloat()
const
68 tflite::LeakyReluParams op_params{};
74void LeakyRelu::evalQuantized()
const
76 tflite::LeakyReluParams op_params{};
79 op_params.output_multiplier_alpha = _output_multiplier_alpha;
80 op_params.output_shift_alpha = _output_shift_alpha;
81 op_params.output_multiplier_identity = _output_multiplier_identity;
82 op_params.output_shift_identity = _output_shift_identity;
84 tflite::reference_ops::QuantizeLeakyRelu(
86 getTensorData<uint8_t>(
output()));
const LeakyReluParams & params() const
void resize(const Shape &new_shape)
int32_t zero_point() const
void execute() const override
const Tensor * input() const
void configure() override
LeakyRelu(const Tensor *input, Tensor *output, const LeakyReluParams ¶ms)
#define LUCI_INTERPRETER_CHECK(cond)
tflite::RuntimeShape getTensorShape(const Tensor *tensor)
void quantizeMultiplier(double double_multiplier, int32_t *quantized_multiplier, int *shift)