24.02.1
|
Go to the documentation of this file.
38 template <
typename TOut>
50 template <
typename TOut>
56 template <
typename TOut>
63 template <
typename TOut,
typename TIn>
73 const int WH =
src.shape().x() *
src.shape().y();
74 const int C =
src.shape().z();
75 const int N =
src.shape().total_size() / (WH * C);
77 const std::vector<float> qscales =
src.quantization_info().scale();
79 #pragma omp parallel for collapse(2)
81 for(
int n = 0; n <
N; ++n)
83 for(
int c = 0; c < C; ++c)
85 const size_t idx = n * C * WH + c * WH;
89 for(
int s = 0; s < WH; ++s)
91 dst[idx + s] = dequantize<TOut>(
static_cast<TIn
>(
src[idx + s]), channel_qinfo, src_data_type);
101 #pragma omp parallel for
103 for(
int i = 0; i <
src.num_elements(); ++i)
105 dst[i] =
static_cast<TOut
>(dequantize<TOut>(
static_cast<TIn
>(
src[i]), quantization_info, src_data_type));
@ QSYMM8_PER_CHANNEL
quantized, symmetric per channel fixed-point 8-bit number
float dequantize_qasymm8(uint8_t value, const INFO_TYPE &qinfo)
Dequantize a value given an unsigned 8-bit asymmetric quantization scheme.
SimpleTensor< float > src
SimpleTensor< TOut > dequantization_layer(const SimpleTensor< TIn > &src)
@ QSYMM8
quantized, symmetric fixed-point 8-bit number
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
bool is_data_type_quantized_per_channel(DataType dt)
Check if a given data type is of per channel type.
float dequantize_qsymm16(int16_t value, const UniformQuantizationInfo &qinfo)
Dequantize a value given a 16-bit symmetric quantization scheme.
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
Simple tensor object that stores elements in a consecutive chunk of memory.
float dequantize_qasymm8_signed(int8_t value, const INFO_TYPE &qinfo)
Dequantize a value given a signed 8-bit asymmetric quantization scheme.
Copyright (c) 2017-2024 Arm Limited.
@ F16
16-bit floating-point number
float dequantize(uint8_t value, float scale, int32_t offset)
Dequantize a value given an 8-bit asymmetric quantization scheme.
@ F32
32-bit floating-point number
DataType
Available data types.
const QuantizationInfo qinfo
float dequantize_qsymm8(int8_t value, const UniformQuantizationInfo &qinfo)
Dequantize a value given a 8-bit symmetric quantization scheme.