25.02
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
v
w
Variables
Typedefs
a
b
c
d
f
g
h
i
l
m
n
o
p
q
r
s
t
u
w
Enumerations
a
b
c
d
e
f
g
j
l
m
n
o
p
q
r
s
t
u
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
~
Functions
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
~
Variables
c
d
e
f
j
l
m
o
p
r
s
v
w
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
v
w
Enumerations
Enumerator
Related Functions
Files
File List
File Members
All
a
b
c
d
e
f
g
h
i
l
m
o
r
s
t
u
v
x
z
Functions
a
b
c
d
f
g
i
m
r
s
t
v
z
Variables
Typedefs
Macros
a
c
d
e
f
h
l
m
o
s
t
u
v
x
Examples
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
Dequantize.cpp
Go to the documentation of this file.
1
//
2
// Copyright © 2019, 2024 Arm Ltd. All rights reserved.
3
// SPDX-License-Identifier: MIT
4
//
5
6
#include "
Dequantize.hpp
"
7
8
namespace
armnn
9
{
10
11
void
Dequantize
(
Decoder<float>
& inputDecoder,
12
Encoder<float>
& outputEncoder,
13
const
TensorInfo
& inputInfo,
14
const
TensorInfo
& outputInfo)
15
{
16
ARMNN_THROW_INVALIDARG_MSG_IF_FALSE
(
17
inputInfo.
GetNumElements
() == outputInfo.
GetNumElements
(),
18
"Dequantize: The number of elements in the input and output tensors must be the same."
);
19
for
(
unsigned
int
i = 0; i < inputInfo.
GetNumElements
(); i++)
20
{
21
// inputDecoder.Get() dequantizes the data element from whatever
22
// type is given by inputInfo to fp32 (If MakeDecoder supports that dequantization)
23
// outputEncoder.Set() transforms the data element to whatever type is
24
// given by outputInfo (if MakeEncoder supports that transformation)
25
outputEncoder.
Set
(inputDecoder.
Get
());
26
++outputEncoder;
27
++inputDecoder;
28
}
29
}
30
31
}
// armnn namespace
Dequantize.hpp
ARMNN_THROW_INVALIDARG_MSG_IF_FALSE
#define ARMNN_THROW_INVALIDARG_MSG_IF_FALSE(_cond, _str)
Definition:
Exceptions.hpp:210
armnn::Decoder< float >
armnn::Decoder::Get
virtual IType Get() const =0
armnn::Encoder< float >
armnn::Encoder::Set
virtual void Set(IType right)=0
armnn::TensorInfo
Definition:
Tensor.hpp:153
armnn::TensorInfo::GetNumElements
unsigned int GetNumElements() const
Definition:
Tensor.hpp:198
armnn
Copyright (c) 2021 ARM Limited and Contributors.
Definition:
01_00_quick_start.dox:7
armnn::Dequantize
float Dequantize(QuantizedType value, float scale, int32_t offset)
Dequantize an 8-bit data type into a floating point data type.
Definition:
TypesUtils.cpp:48
src
backends
reference
workloads
Dequantize.cpp
Generated on Mon Feb 17 2025 21:34:26 for Arm NN by
1.9.1