ArmNN
 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 
14 {
16  : m_InputToInputWeights(nullptr)
17  , m_InputToForgetWeights(nullptr)
18  , m_InputToCellWeights(nullptr)
19  , m_InputToOutputWeights(nullptr)
20 
21  , m_RecurrentToInputWeights(nullptr)
23  , m_RecurrentToCellWeights(nullptr)
25 
26  , m_InputGateBias(nullptr)
27  , m_ForgetGateBias(nullptr)
28  , m_CellBias(nullptr)
29  , m_OutputGateBias(nullptr)
30  {
31  }
32 
37 
42 
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 
59  {
61  }
62 
64  {
66  }
67 
69  {
71  }
72 
74  {
76  }
77 
79  {
81  }
82 
84  {
86  }
87 
89  {
91  }
92 
94  {
96  }
97 
99  {
100  return Deref(m_InputGateBias);
101  }
102 
104  {
105  return Deref(m_ForgetGateBias);
106  }
107 
108  const ConstTensor& GetCellBias() const
109  {
110  return Deref(m_CellBias);
111  }
112 
114  {
115  return Deref(m_OutputGateBias);
116  }
117 };
118 
120 {
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 
143 
148 
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 
166  {
168  }
170  {
172  }
174  {
175  return Deref(m_InputToCellWeights);
176  }
178  {
180  }
181 
183  {
185  }
187  {
189  }
191  {
193  }
195  {
197  }
198 
200  {
201  return Deref(m_InputGateBias);
202  }
204  {
205  return Deref(m_ForgetGateBias);
206  }
207  const TensorInfo& GetCellBias() const
208  {
209  return Deref(m_CellBias);
210  }
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