26#include "PALLogistic.h"
34constexpr uint32_t inputTensorIdx = 0;
42 const circle::Tensor *
input =
nullptr;
43 const circle::Tensor *
output =
nullptr;
48 SISOHeader(execute_args, &input, &output, &input_data, &output_data);
52 switch (
input->type())
55 case circle::TensorType_FLOAT32:
58 core::utils::castInputData<float>(input_data),
59 core::utils::castOutputData<float>(output_data));
64 case circle::TensorType_INT8:
66 assert(
input->quantization() !=
nullptr);
67 assert(
input->quantization()->scale() !=
nullptr);
68 assert(
input->quantization()->scale()->size() == 1);
69 assert(
input->quantization()->zero_point() !=
nullptr);
70 assert(
input->quantization()->zero_point()->size() == 1);
72 assert(
output->quantization() !=
nullptr);
73 assert(
output->quantization()->scale() !=
nullptr);
74 assert(
output->quantization()->scale()->size() == 1);
75 assert(
output->quantization()->zero_point() !=
nullptr);
76 assert(
output->quantization()->zero_point()->size() == 1);
78 auto input_scale = *
input->quantization()->scale()->begin();
79 auto input_zero_point = *
input->quantization()->zero_point()->begin();
80 auto output_scale = *
input->quantization()->scale()->begin();
81 auto output_zero_point = *
input->quantization()->zero_point()->begin();
84 core::utils::castInputData<int8_t>(input_data), input_scale,
85 input_zero_point, core::utils::castOutputData<int8_t>(output_data),
86 output_scale, output_zero_point);
93 assert(
false &&
"Unsupported type.");
constexpr uint32_t outputTensorIdx
OMStatus Logistic(const int flat_size, const float *input_data, float *output_data)
OMStatus SISOHeader(const OMExecuteArgs &execute_args, const circle::Tensor **input, const circle::Tensor **output, uint8_t **input_data, uint8_t **output_data)