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);
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 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
DataType data_type() const override
Data type of the tensor.
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
TensorShape shape() const override
Shape of the tensor.
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
int num_elements() const override
Number of elements of the tensor.
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.
QuantizationInfo quantization_info() const override
Quantization info in case of asymmetric quantized type.
DataType
Available data types.