19#include "kernels/Utils.h"
22#include <tensorflow/lite/kernels/internal/quantization_util.h>
50 input()->element_type() == loco::DataType::S8);
54 if (
input()->element_type() == loco::DataType::S8)
58 weight_time()->element_type() == loco::DataType::S8);
69 else if (
weight_feature()->element_type() == loco::DataType::FLOAT32)
78 else if ((
weight_feature()->element_type() == loco::DataType::U8 ||
80 input()->element_type() == loco::DataType::FLOAT32)
83 throw std::runtime_error(
"Hybrid type is not currently supported");
87 throw std::runtime_error(
"luci-intp SVDF Unsupported type.");
125 luci_interpreter_pal::SetupScratchpadTensor(
135 case loco::DataType::FLOAT32:
138 case loco::DataType::S8:
140 if (
input()->element_type() == loco::DataType::S8)
144 throw std::runtime_error(
"Hybrid type is not currently supported");
148 throw std::runtime_error(
"Unsupported type");
152void SVDF::evalInteger()
const
159 int32_t effective_scale_1_a;
160 int effective_scale_1_b;
161 int32_t effective_scale_2_a;
162 int effective_scale_2_b;
164 tflite::QuantizeMultiplier(
effective_scale_1, &effective_scale_1_a, &effective_scale_1_b);
165 tflite::QuantizeMultiplier(
effective_scale_2, &effective_scale_2_a, &effective_scale_2_b);
183 luci_interpreter_pal::IntegerSVDF(
190 effective_scale_2_a, effective_scale_2_b, input_zp, output_zp);
193void SVDF::evalFloat()
const
208 luci_interpreter_pal::FloatSVDF(
const std::vector< Tensor * > & getOutputTensors() const
const SVDFParams & params() const
void resize(const Shape &new_shape)
const Shape & shape() const
int32_t zero_point() const
const Tensor * input() const
void execute() const override
SVDF(const Tensor *input, const Tensor *weight_feature, const Tensor *weight_time, const Tensor *bias, const Tensor *input_activation_state, Tensor *output, Tensor *scratchpad_activation_state, Tensor *scratchpad_1, Tensor *scratchpad_2, Tensor *scratchpad_3, Tensor *scratchpad_4, Tensor *scratchpad_5, Tensor *scratchpad_6, const SVDFParams ¶ms)
const Tensor * input_activation_state() const
const Tensor * bias() const
const Tensor * weight_feature() const
const Tensor * weight_time() const
void configure() override
#define LUCI_INTERPRETER_CHECK(cond)
TfLiteFusedActivation getTfLiteActivation(Activation activation)
tflite::RuntimeShape getTensorShape(const Tensor *tensor)
T must_cast(loco::Node *node)
bool asymmetric_quantize_inputs