17#ifndef LUCI_INTERPRETER_PAL_SOFTMAX_H
18#define LUCI_INTERPRETER_PAL_SOFTMAX_H
20#include <tensorflow/lite/kernels/internal/reference/softmax.h>
33static inline void InitializeParams(tflite::SoftmaxParams *params,
float input_scale,
float beta)
35 int32 input_beta_multiplier;
36 int input_beta_left_shift;
37 static const int kScaledDiffIntegerBits = 5;
38 tflite::PreprocessSoftmaxScaling(beta, input_scale, kScaledDiffIntegerBits,
39 &input_beta_multiplier, &input_beta_left_shift);
41 params->input_multiplier = input_beta_multiplier;
42 params->input_left_shift = input_beta_left_shift;
44 -tflite::CalculateInputRadius(kScaledDiffIntegerBits, params->input_left_shift);
48static inline void Softmax(
const tflite::SoftmaxParams ¶ms,
49 const tflite::RuntimeShape &input_shape,
const T *input_data,
50 const tflite::RuntimeShape &
output_shape, T *output_data)
53 assert(
false &&
"Softmax NYI");
const luci_interpreter::RuntimeShape output_shape
void Softmax(const SoftmaxParams ¶ms, const Shape &input_shape, const float *input_data, const Shape &output_shape, float *output_data)
void PopulateSoftmaxLookupTable(float *table, float input_scale, float beta)