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));
float dequantize_qasymm8(uint8_t value, const INFO_TYPE &qinfo)
Dequantize a value given an unsigned 8-bit asymmetric quantization scheme.
SimpleTensor< TOut > dequantization_layer(const SimpleTensor< TIn > &src)
1 channel, 1 F32 per channel
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
SimpleTensor< float > src
Copyright (c) 2017-2021 Arm Limited.
1 channel, 1 F16 per channel
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
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.
quantized, symmetric fixed-point 8-bit number
quantized, symmetric per channel fixed-point 8-bit number
Simple tensor object that stores elements in a consecutive chunk of memory.
const QuantizationInfo qinfo
float dequantize_qasymm8_signed(int8_t value, const INFO_TYPE &qinfo)
Dequantize a value given a signed 8-bit asymmetric quantization scheme.
float dequantize_qsymm8(int8_t value, const UniformQuantizationInfo &qinfo)
Dequantize a value given a 8-bit symmetric quantization scheme.
float dequantize(uint8_t value, float scale, int32_t offset)
Dequantize a value given an 8-bit asymmetric quantization scheme.
DataType
Available data types.