28 const InputT *input_data, OutputT *output_data)
30 const int32_t zero_point = op_params.
zero_point;
31 const double scale = op_params.
scale;
32 static constexpr int32_t min_val = std::numeric_limits<OutputT>::min();
33 static constexpr int32_t max_val = std::numeric_limits<OutputT>::max();
35 for (
int i = 0; i < flat_size; i++)
37 const InputT val = input_data[i];
39 static_cast<int32_t
>(std::round(val /
static_cast<float>(scale))) + zero_point;
40 int32_t clamped = std::min(std::max(unclamped, min_val), max_val);
41 output_data[i] = clamped;