24.08
QuantizedLstmParams.hpp
Go to the documentation of this file.
1
//
2
// Copyright © 2017 Arm Ltd. All rights reserved.
3
// SPDX-License-Identifier: MIT
4
//
5
#pragma once
6
7
#include "
TensorFwd.hpp
"
8
#include "
Exceptions.hpp
"
9
10
namespace
armnn
11
{
12
13
struct
QuantizedLstmInputParams
14
{
15
QuantizedLstmInputParams
()
16
:
m_InputToInputWeights
(nullptr)
17
,
m_InputToForgetWeights
(nullptr)
18
,
m_InputToCellWeights
(nullptr)
19
,
m_InputToOutputWeights
(nullptr)
20
21
,
m_RecurrentToInputWeights
(nullptr)
22
,
m_RecurrentToForgetWeights
(nullptr)
23
,
m_RecurrentToCellWeights
(nullptr)
24
,
m_RecurrentToOutputWeights
(nullptr)
25
26
,
m_InputGateBias
(nullptr)
27
,
m_ForgetGateBias
(nullptr)
28
,
m_CellBias
(nullptr)
29
,
m_OutputGateBias
(nullptr)
30
{
31
}
32
33
const
ConstTensor
*
m_InputToInputWeights
;
34
const
ConstTensor
*
m_InputToForgetWeights
;
35
const
ConstTensor
*
m_InputToCellWeights
;
36
const
ConstTensor
*
m_InputToOutputWeights
;
37
38
const
ConstTensor
*
m_RecurrentToInputWeights
;
39
const
ConstTensor
*
m_RecurrentToForgetWeights
;
40
const
ConstTensor
*
m_RecurrentToCellWeights
;
41
const
ConstTensor
*
m_RecurrentToOutputWeights
;
42
43
const
ConstTensor
*
m_InputGateBias
;
44
const
ConstTensor
*
m_ForgetGateBias
;
45
const
ConstTensor
*
m_CellBias
;
46
const
ConstTensor
*
m_OutputGateBias
;
47
48
const
ConstTensor
&
Deref
(
const
ConstTensor
* tensorPtr)
const
49
{
50
if
(tensorPtr !=
nullptr
)
51
{
52
const
ConstTensor
&temp = *tensorPtr;
53
return
temp;
54
}
55
throw
InvalidArgumentException
(
"QuantizedLstmInputParams: Can't dereference a null pointer"
);
56
}
57
58
const
ConstTensor
&
GetInputToInputWeights
()
const
59
{
60
return
Deref
(
m_InputToInputWeights
);
61
}
62
63
const
ConstTensor
&
GetInputToForgetWeights
()
const
64
{
65
return
Deref
(
m_InputToForgetWeights
);
66
}
67
68
const
ConstTensor
&
GetInputToCellWeights
()
const
69
{
70
return
Deref
(
m_InputToCellWeights
);
71
}
72
73
const
ConstTensor
&
GetInputToOutputWeights
()
const
74
{
75
return
Deref
(
m_InputToOutputWeights
);
76
}
77
78
const
ConstTensor
&
GetRecurrentToInputWeights
()
const
79
{
80
return
Deref
(
m_RecurrentToInputWeights
);
81
}
82
83
const
ConstTensor
&
GetRecurrentToForgetWeights
()
const
84
{
85
return
Deref
(
m_RecurrentToForgetWeights
);
86
}
87
88
const
ConstTensor
&
GetRecurrentToCellWeights
()
const
89
{
90
return
Deref
(
m_RecurrentToCellWeights
);
91
}
92
93
const
ConstTensor
&
GetRecurrentToOutputWeights
()
const
94
{
95
return
Deref
(
m_RecurrentToOutputWeights
);
96
}
97
98
const
ConstTensor
&
GetInputGateBias
()
const
99
{
100
return
Deref
(
m_InputGateBias
);
101
}
102
103
const
ConstTensor
&
GetForgetGateBias
()
const
104
{
105
return
Deref
(
m_ForgetGateBias
);
106
}
107
108
const
ConstTensor
&
GetCellBias
()
const
109
{
110
return
Deref
(
m_CellBias
);
111
}
112
113
const
ConstTensor
&
GetOutputGateBias
()
const
114
{
115
return
Deref
(
m_OutputGateBias
);
116
}
117
};
118
119
struct
QuantizedLstmInputParamsInfo
120
{
121
QuantizedLstmInputParamsInfo
()
122
:
m_InputToInputWeights
(nullptr)
123
,
m_InputToForgetWeights
(nullptr)
124
,
m_InputToCellWeights
(nullptr)
125
,
m_InputToOutputWeights
(nullptr)
126
127
,
m_RecurrentToInputWeights
(nullptr)
128
,
m_RecurrentToForgetWeights
(nullptr)
129
,
m_RecurrentToCellWeights
(nullptr)
130
,
m_RecurrentToOutputWeights
(nullptr)
131
132
,
m_InputGateBias
(nullptr)
133
,
m_ForgetGateBias
(nullptr)
134
,
m_CellBias
(nullptr)
135
,
m_OutputGateBias
(nullptr)
136
{
137
}
138
139
const
TensorInfo
*
m_InputToInputWeights
;
140
const
TensorInfo
*
m_InputToForgetWeights
;
141
const
TensorInfo
*
m_InputToCellWeights
;
142
const
TensorInfo
*
m_InputToOutputWeights
;
143
144
const
TensorInfo
*
m_RecurrentToInputWeights
;
145
const
TensorInfo
*
m_RecurrentToForgetWeights
;
146
const
TensorInfo
*
m_RecurrentToCellWeights
;
147
const
TensorInfo
*
m_RecurrentToOutputWeights
;
148
149
const
TensorInfo
*
m_InputGateBias
;
150
const
TensorInfo
*
m_ForgetGateBias
;
151
const
TensorInfo
*
m_CellBias
;
152
const
TensorInfo
*
m_OutputGateBias
;
153
154
155
const
TensorInfo
&
Deref
(
const
TensorInfo
* tensorInfo)
const
156
{
157
if
(tensorInfo !=
nullptr
)
158
{
159
const
TensorInfo
&temp = *tensorInfo;
160
return
temp;
161
}
162
throw
InvalidArgumentException
(
"Can't dereference a null pointer"
);
163
}
164
165
const
TensorInfo
&
GetInputToInputWeights
()
const
166
{
167
return
Deref
(
m_InputToInputWeights
);
168
}
169
const
TensorInfo
&
GetInputToForgetWeights
()
const
170
{
171
return
Deref
(
m_InputToForgetWeights
);
172
}
173
const
TensorInfo
&
GetInputToCellWeights
()
const
174
{
175
return
Deref
(
m_InputToCellWeights
);
176
}
177
const
TensorInfo
&
GetInputToOutputWeights
()
const
178
{
179
return
Deref
(
m_InputToOutputWeights
);
180
}
181
182
const
TensorInfo
&
GetRecurrentToInputWeights
()
const
183
{
184
return
Deref
(
m_RecurrentToInputWeights
);
185
}
186
const
TensorInfo
&
GetRecurrentToForgetWeights
()
const
187
{
188
return
Deref
(
m_RecurrentToForgetWeights
);
189
}
190
const
TensorInfo
&
GetRecurrentToCellWeights
()
const
191
{
192
return
Deref
(
m_RecurrentToCellWeights
);
193
}
194
const
TensorInfo
&
GetRecurrentToOutputWeights
()
const
195
{
196
return
Deref
(
m_RecurrentToOutputWeights
);
197
}
198
199
const
TensorInfo
&
GetInputGateBias
()
const
200
{
201
return
Deref
(
m_InputGateBias
);
202
}
203
const
TensorInfo
&
GetForgetGateBias
()
const
204
{
205
return
Deref
(
m_ForgetGateBias
);
206
}
207
const
TensorInfo
&
GetCellBias
()
const
208
{
209
return
Deref
(
m_CellBias
);
210
}
211
const
TensorInfo
&
GetOutputGateBias
()
const
212
{
213
return
Deref
(
m_OutputGateBias
);
214
}
215
};
216
217
}
// namespace armnn
218
armnn::QuantizedLstmInputParamsInfo::GetForgetGateBias
const TensorInfo & GetForgetGateBias() const
Definition:
QuantizedLstmParams.hpp:203
armnn::QuantizedLstmInputParams::GetOutputGateBias
const ConstTensor & GetOutputGateBias() const
Definition:
QuantizedLstmParams.hpp:113
armnn::QuantizedLstmInputParamsInfo::GetInputToForgetWeights
const TensorInfo & GetInputToForgetWeights() const
Definition:
QuantizedLstmParams.hpp:169
armnn::QuantizedLstmInputParamsInfo::GetRecurrentToForgetWeights
const TensorInfo & GetRecurrentToForgetWeights() const
Definition:
QuantizedLstmParams.hpp:186
armnn::QuantizedLstmInputParams::GetForgetGateBias
const ConstTensor & GetForgetGateBias() const
Definition:
QuantizedLstmParams.hpp:103
armnn::QuantizedLstmInputParamsInfo::m_InputToCellWeights
const TensorInfo * m_InputToCellWeights
Definition:
QuantizedLstmParams.hpp:141
armnn::QuantizedLstmInputParamsInfo::m_ForgetGateBias
const TensorInfo * m_ForgetGateBias
Definition:
QuantizedLstmParams.hpp:150
armnn::QuantizedLstmInputParams::m_InputToOutputWeights
const ConstTensor * m_InputToOutputWeights
Definition:
QuantizedLstmParams.hpp:36
armnn::TensorInfo
Definition:
Tensor.hpp:152
armnn::QuantizedLstmInputParamsInfo::m_RecurrentToOutputWeights
const TensorInfo * m_RecurrentToOutputWeights
Definition:
QuantizedLstmParams.hpp:147
armnn::QuantizedLstmInputParamsInfo::m_CellBias
const TensorInfo * m_CellBias
Definition:
QuantizedLstmParams.hpp:151
armnn::QuantizedLstmInputParams::m_RecurrentToInputWeights
const ConstTensor * m_RecurrentToInputWeights
Definition:
QuantizedLstmParams.hpp:38
armnn::QuantizedLstmInputParams::GetInputToInputWeights
const ConstTensor & GetInputToInputWeights() const
Definition:
QuantizedLstmParams.hpp:58
armnn::QuantizedLstmInputParams::m_RecurrentToForgetWeights
const ConstTensor * m_RecurrentToForgetWeights
Definition:
QuantizedLstmParams.hpp:39
armnn::QuantizedLstmInputParams::m_ForgetGateBias
const ConstTensor * m_ForgetGateBias
Definition:
QuantizedLstmParams.hpp:44
armnn::QuantizedLstmInputParams::m_RecurrentToCellWeights
const ConstTensor * m_RecurrentToCellWeights
Definition:
QuantizedLstmParams.hpp:40
armnn::QuantizedLstmInputParamsInfo::GetInputGateBias
const TensorInfo & GetInputGateBias() const
Definition:
QuantizedLstmParams.hpp:199
armnn::QuantizedLstmInputParamsInfo::m_OutputGateBias
const TensorInfo * m_OutputGateBias
Definition:
QuantizedLstmParams.hpp:152
armnn::QuantizedLstmInputParamsInfo
Definition:
QuantizedLstmParams.hpp:119
TensorFwd.hpp
armnn::QuantizedLstmInputParamsInfo::m_InputToOutputWeights
const TensorInfo * m_InputToOutputWeights
Definition:
QuantizedLstmParams.hpp:142
armnn::QuantizedLstmInputParamsInfo::GetRecurrentToOutputWeights
const TensorInfo & GetRecurrentToOutputWeights() const
Definition:
QuantizedLstmParams.hpp:194
armnn::QuantizedLstmInputParams::GetRecurrentToOutputWeights
const ConstTensor & GetRecurrentToOutputWeights() const
Definition:
QuantizedLstmParams.hpp:93
armnn::QuantizedLstmInputParamsInfo::GetInputToInputWeights
const TensorInfo & GetInputToInputWeights() const
Definition:
QuantizedLstmParams.hpp:165
armnn::QuantizedLstmInputParamsInfo::m_InputGateBias
const TensorInfo * m_InputGateBias
Definition:
QuantizedLstmParams.hpp:149
armnn::QuantizedLstmInputParams::m_RecurrentToOutputWeights
const ConstTensor * m_RecurrentToOutputWeights
Definition:
QuantizedLstmParams.hpp:41
armnn::QuantizedLstmInputParamsInfo::GetCellBias
const TensorInfo & GetCellBias() const
Definition:
QuantizedLstmParams.hpp:207
armnn::QuantizedLstmInputParams::GetInputToCellWeights
const ConstTensor & GetInputToCellWeights() const
Definition:
QuantizedLstmParams.hpp:68
armnn::InvalidArgumentException
Definition:
Exceptions.hpp:80
armnn::QuantizedLstmInputParams::GetRecurrentToCellWeights
const ConstTensor & GetRecurrentToCellWeights() const
Definition:
QuantizedLstmParams.hpp:88
armnn::QuantizedLstmInputParamsInfo::QuantizedLstmInputParamsInfo
QuantizedLstmInputParamsInfo()
Definition:
QuantizedLstmParams.hpp:121
armnn::QuantizedLstmInputParams::GetRecurrentToInputWeights
const ConstTensor & GetRecurrentToInputWeights() const
Definition:
QuantizedLstmParams.hpp:78
armnn::QuantizedLstmInputParamsInfo::GetRecurrentToCellWeights
const TensorInfo & GetRecurrentToCellWeights() const
Definition:
QuantizedLstmParams.hpp:190
armnn::QuantizedLstmInputParamsInfo::m_InputToInputWeights
const TensorInfo * m_InputToInputWeights
Definition:
QuantizedLstmParams.hpp:139
armnn::QuantizedLstmInputParamsInfo::GetInputToOutputWeights
const TensorInfo & GetInputToOutputWeights() const
Definition:
QuantizedLstmParams.hpp:177
armnn::QuantizedLstmInputParams::m_InputToForgetWeights
const ConstTensor * m_InputToForgetWeights
Definition:
QuantizedLstmParams.hpp:34
armnn::QuantizedLstmInputParams::GetCellBias
const ConstTensor & GetCellBias() const
Definition:
QuantizedLstmParams.hpp:108
armnn::QuantizedLstmInputParams::m_OutputGateBias
const ConstTensor * m_OutputGateBias
Definition:
QuantizedLstmParams.hpp:46
armnn::QuantizedLstmInputParams::GetInputToOutputWeights
const ConstTensor & GetInputToOutputWeights() const
Definition:
QuantizedLstmParams.hpp:73
armnn::QuantizedLstmInputParams::GetRecurrentToForgetWeights
const ConstTensor & GetRecurrentToForgetWeights() const
Definition:
QuantizedLstmParams.hpp:83
armnn::QuantizedLstmInputParamsInfo::Deref
const TensorInfo & Deref(const TensorInfo *tensorInfo) const
Definition:
QuantizedLstmParams.hpp:155
armnn::QuantizedLstmInputParams::m_InputToInputWeights
const ConstTensor * m_InputToInputWeights
Definition:
QuantizedLstmParams.hpp:33
armnn::QuantizedLstmInputParamsInfo::GetOutputGateBias
const TensorInfo & GetOutputGateBias() const
Definition:
QuantizedLstmParams.hpp:211
armnn::QuantizedLstmInputParams::m_CellBias
const ConstTensor * m_CellBias
Definition:
QuantizedLstmParams.hpp:45
armnn::QuantizedLstmInputParams::Deref
const ConstTensor & Deref(const ConstTensor *tensorPtr) const
Definition:
QuantizedLstmParams.hpp:48
armnn::QuantizedLstmInputParamsInfo::m_RecurrentToCellWeights
const TensorInfo * m_RecurrentToCellWeights
Definition:
QuantizedLstmParams.hpp:146
Exceptions.hpp
armnn
Copyright (c) 2021 ARM Limited and Contributors.
Definition:
01_00_quick_start.dox:6
armnn::QuantizedLstmInputParams::GetInputToForgetWeights
const ConstTensor & GetInputToForgetWeights() const
Definition:
QuantizedLstmParams.hpp:63
armnn::ConstTensor
A tensor defined by a TensorInfo (shape and data type) and an immutable backing store.
Definition:
Tensor.hpp:329
armnn::QuantizedLstmInputParamsInfo::m_RecurrentToInputWeights
const TensorInfo * m_RecurrentToInputWeights
Definition:
QuantizedLstmParams.hpp:144
armnn::QuantizedLstmInputParams::QuantizedLstmInputParams
QuantizedLstmInputParams()
Definition:
QuantizedLstmParams.hpp:15
armnn::QuantizedLstmInputParamsInfo::m_InputToForgetWeights
const TensorInfo * m_InputToForgetWeights
Definition:
QuantizedLstmParams.hpp:140
armnn::QuantizedLstmInputParams::GetInputGateBias
const ConstTensor & GetInputGateBias() const
Definition:
QuantizedLstmParams.hpp:98
armnn::QuantizedLstmInputParams::m_InputGateBias
const ConstTensor * m_InputGateBias
Definition:
QuantizedLstmParams.hpp:43
armnn::QuantizedLstmInputParamsInfo::GetInputToCellWeights
const TensorInfo & GetInputToCellWeights() const
Definition:
QuantizedLstmParams.hpp:173
armnn::QuantizedLstmInputParams
Definition:
QuantizedLstmParams.hpp:13
armnn::QuantizedLstmInputParamsInfo::GetRecurrentToInputWeights
const TensorInfo & GetRecurrentToInputWeights() const
Definition:
QuantizedLstmParams.hpp:182
armnn::QuantizedLstmInputParams::m_InputToCellWeights
const ConstTensor * m_InputToCellWeights
Definition:
QuantizedLstmParams.hpp:35
armnn::QuantizedLstmInputParamsInfo::m_RecurrentToForgetWeights
const TensorInfo * m_RecurrentToForgetWeights
Definition:
QuantizedLstmParams.hpp:145
include
armnn
QuantizedLstmParams.hpp
Generated on Wed Aug 28 2024 14:31:47 for Arm NN by
1.8.17