ArmNN
 24.02
QLstmLayer.cpp
Go to the documentation of this file.
1 //
2 // Copyright © 2020-2023 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 #include "QLstmLayer.hpp"
6 
7 #include "LayerCloneBase.hpp"
8 
9 #include <armnn/LstmParams.hpp>
10 #include <armnn/TypesUtils.hpp>
13 
14 namespace armnn
15 {
16 
17 QLstmLayer::QLstmLayer(const QLstmDescriptor& param, const char* name)
18  : LayerWithParameters(3, 3, LayerType::QLstm, param, name)
19 {
20 }
21 
22 std::unique_ptr<IWorkload> QLstmLayer::CreateWorkload(const IWorkloadFactory& factory) const
23 {
24  QLstmQueueDescriptor descriptor;
25 
26  // Basic parameters
34  descriptor.m_CellBias = m_BasicParameters.m_CellBias.get();
36 
37  // CIFG parameters
39  {
43  }
44 
45  // Projection parameters
47  {
50  }
51 
52  // Peephole parameters
54  {
56  {
58  }
59 
62  }
63 
64  // Layer normalisation parameters
66  {
68  {
70  }
74  }
75 
76  SetAdditionalInfo(descriptor);
77 
78  return factory.CreateWorkload(LayerType::QLstm, descriptor, PrepInfoAndDesc(descriptor));
79 }
80 
82 {
83  auto layer = CloneBase<QLstmLayer>(graph, m_Param, GetName());
84 
85  layer->m_BasicParameters.m_InputToForgetWeights = m_BasicParameters.m_InputToForgetWeights ?
87  layer->m_BasicParameters.m_InputToCellWeights = m_BasicParameters.m_InputToCellWeights ?
89  layer->m_BasicParameters.m_InputToOutputWeights = m_BasicParameters.m_InputToOutputWeights ?
91  layer->m_BasicParameters.m_RecurrentToForgetWeights = m_BasicParameters.m_RecurrentToForgetWeights ?
93  layer->m_BasicParameters.m_RecurrentToCellWeights = m_BasicParameters.m_RecurrentToCellWeights ?
95  layer->m_BasicParameters.m_RecurrentToOutputWeights = m_BasicParameters.m_RecurrentToOutputWeights ?
97  layer->m_BasicParameters.m_ForgetGateBias = m_BasicParameters.m_ForgetGateBias ?
99  layer->m_BasicParameters.m_CellBias = m_BasicParameters.m_CellBias ?
100  m_BasicParameters.m_CellBias : nullptr;
101  layer->m_BasicParameters.m_OutputGateBias = m_BasicParameters.m_OutputGateBias ?
103 
104  if (!m_Param.m_CifgEnabled)
105  {
106  layer->m_CifgParameters.m_InputToInputWeights = m_CifgParameters.m_InputToInputWeights ?
108  layer->m_CifgParameters.m_RecurrentToInputWeights = m_CifgParameters.m_RecurrentToInputWeights ?
110  layer->m_CifgParameters.m_InputGateBias = m_CifgParameters.m_InputGateBias ?
112  }
113 
115  {
116  layer->m_ProjectionParameters.m_ProjectionWeights = m_ProjectionParameters.m_ProjectionWeights ?
118  layer->m_ProjectionParameters.m_ProjectionBias = m_ProjectionParameters.m_ProjectionBias ?
120  }
121 
123  {
124  if (!m_Param.m_CifgEnabled) {
125  layer->m_PeepholeParameters.m_CellToInputWeights = m_PeepholeParameters.m_CellToInputWeights ?
127  }
128 
129  layer->m_PeepholeParameters.m_CellToForgetWeights = m_PeepholeParameters.m_CellToForgetWeights ?
131  layer->m_PeepholeParameters.m_CellToOutputWeights = m_PeepholeParameters.m_CellToOutputWeights ?
133  }
134 
136  {
137  if (!m_Param.m_CifgEnabled) {
138  layer->m_LayerNormParameters.m_InputLayerNormWeights = m_LayerNormParameters.m_InputLayerNormWeights ?
140  }
141 
142  layer->m_LayerNormParameters.m_ForgetLayerNormWeights = m_LayerNormParameters.m_ForgetLayerNormWeights ?
144  layer->m_LayerNormParameters.m_CellLayerNormWeights = m_LayerNormParameters.m_CellLayerNormWeights ?
146  layer->m_LayerNormParameters.m_OutputLayerNormWeights = m_LayerNormParameters.m_OutputLayerNormWeights ?
148  }
149 
150  return std::move(layer);
151 }
152 
153 std::vector<TensorShape> QLstmLayer::InferOutputShapes(const std::vector<TensorShape>& inputShapes) const
154 {
155  ARMNN_ASSERT(inputShapes.size() == 3);
156 
157  // Get input values for validation
158  unsigned int batchSize = inputShapes[0][0];
159  unsigned int outputSize = inputShapes[1][1];
160  unsigned int numUnits = inputShapes[2][1];
161 
162  std::vector<TensorShape> outShapes;
163  outShapes.push_back(TensorShape({ batchSize, outputSize })); // outputStateOut
164  outShapes.push_back(TensorShape({ batchSize, numUnits })); // cellStateOut
165  outShapes.push_back(TensorShape({ batchSize, outputSize })); // output
166 
167  return outShapes;
168 }
169 
171 {
173 
174  const TensorShape& outputShape = GetOutputSlot(0).GetTensorInfo().GetShape();
175 
177 
178  auto inferredShapes = InferOutputShapes(
179  {
180  GetInputSlot(0).GetTensorInfo().GetShape(), // input
181  GetInputSlot(1).GetTensorInfo().GetShape(), // previousOutputIn
182  GetInputSlot(2).GetTensorInfo().GetShape() // previousCellStateIn
183  });
184 
185  ARMNN_ASSERT(inferredShapes.size() == 3);
186 
187  // Check if the weights are nullptr for basic params
189  "QLstmLayer: m_BasicParameters.m_InputToForgetWeights should not be null.");
191  "QLstmLayer: m_BasicParameters.m_InputToCellWeights should not be null.");
193  "QLstmLayer: m_BasicParameters.m_InputToOutputWeights should not be null.");
195  "QLstmLayer: m_BasicParameters.m_RecurrentToForgetWeights should not be null.");
197  "QLstmLayer: m_BasicParameters.m_RecurrentToCellWeights should not be null.");
199  "QLstmLayer: m_BasicParameters.m_RecurrentToOutputWeights should not be null.");
201  "QLstmLayer: m_BasicParameters.m_ForgetGateBias should not be null.");
203  "QLstmLayer: m_BasicParameters.m_CellBias should not be null.");
205  "QLstmLayer: m_BasicParameters.m_OutputGateBias should not be null.");
206 
207  if (!m_Param.m_CifgEnabled)
208  {
210  "QLstmLayer: m_CifgParameters.m_InputToInputWeights should not be null.");
212  "QLstmLayer: m_CifgParameters.m_RecurrentToInputWeights should not be null.");
214  "QLstmLayer: m_CifgParameters.m_InputGateBias should not be null.");
215 
216  ValidateAndCopyShape(outputShape, inferredShapes[0], m_ShapeInferenceMethod, "QLstmLayer");
217  }
218  else
219  {
221  "QLstmLayer: m_CifgParameters.m_InputToInputWeights should not have a value when CIFG is enabled.");
223  "QLstmLayer: m_CifgParameters.m_RecurrentToInputWeights should "
224  "not have a value when CIFG is enabled.");
226  "QLstmLayer: m_CifgParameters.m_InputGateBias should not have a value when CIFG is enabled.");
227 
228  ValidateAndCopyShape(outputShape, inferredShapes[0], m_ShapeInferenceMethod, "QLstmLayer");
229  }
230 
232  {
234  "QLstmLayer: m_ProjectionParameters.m_ProjectionWeights should not be null.");
235  }
236 
238  {
239  if (!m_Param.m_CifgEnabled) {
241  "QLstmLayer: m_PeepholeParameters.m_CellToInputWeights should not be null "
242  "when Peephole is enabled and CIFG is disabled.");
243  }
244 
246  "QLstmLayer: m_PeepholeParameters.m_CellToForgetWeights should not be null.");
248  "QLstmLayer: m_PeepholeParameters.m_CellToOutputWeights should not be null.");
249  }
250 
252  GetOutputSlot(1).GetTensorInfo().GetShape(), inferredShapes[1], m_ShapeInferenceMethod, "QLstmLayer", 1);
254  GetOutputSlot(2).GetTensorInfo().GetShape(), inferredShapes[2], m_ShapeInferenceMethod, "QLstmLayer", 2);
255 
257  {
259  {
261  "QLstmLayer: m_LayerNormParameters.m_InputLayerNormWeights should not be null.");
262  }
264  "QLstmLayer: m_LayerNormParameters.m_ForgetLayerNormWeights should not be null.");
266  "QLstmLayer: m_LayerNormParameters.m_CellLayerNormWeights should not be null.");
268  "QLstmLayer: m_LayerNormParameters.m_UutputLayerNormWeights should not be null.");
269  }
270 }
271 
273 {
274  // For API stability DO NOT ALTER order and add new members to the end of vector
284 
285  // Cifg parameters
289 
290  // Projection parameters
293 
294  // Peephole parameters
298 
299  // Layer normalisation parameters
304 }
305 
306 
308 {
309  std::vector<ConstTensor> constTensors;
319 
320  // Cifg parameters
324 
325  // Projection parameters
328 
329  // Peephole parameters
333 
334  // Layer normalisation parameters
339 
340  // First add mandatory/basic parameters
342  {
343  constTensors.emplace_back(ConstTensor(managedInputToForgetWeights.GetTensorInfo(),
344  managedInputToForgetWeights.Map()));
345  }
347  {
348  constTensors.emplace_back(ConstTensor(managedInputToCellWeights.GetTensorInfo(),
349  managedInputToCellWeights.Map()));
350  }
352  {
353  constTensors.emplace_back(ConstTensor(managedInputToOutputWeights.GetTensorInfo(),
354  managedInputToOutputWeights.Map()));
355  }
357  {
358  constTensors.emplace_back(ConstTensor(
359  managedRecurrentToForgetWeights.GetTensorInfo(),
360  managedRecurrentToForgetWeights.Map()));
361  }
363  {
364  constTensors.emplace_back(ConstTensor(
365  managedRecurrentToCellWeights.GetTensorInfo(),
366  managedRecurrentToCellWeights.Map()));
367  }
369  {
370  constTensors.emplace_back(ConstTensor(
371  managedRecurrentToOutputWeights.GetTensorInfo(),
372  managedRecurrentToOutputWeights.Map()));
373  }
374  if (m_BasicParameters.m_ForgetGateBias != nullptr)
375  {
376  constTensors.emplace_back(ConstTensor(managedForgetGateBias.GetTensorInfo(),
377  managedForgetGateBias.Map()));
378  }
379  if (m_BasicParameters.m_CellBias != nullptr)
380  {
381  constTensors.emplace_back(ConstTensor(managedCellBias.GetTensorInfo(),
382  managedCellBias.Map()));
383  }
384  if (m_BasicParameters.m_OutputGateBias != nullptr)
385  {
386  constTensors.emplace_back(ConstTensor(managedOutputGateBias.GetTensorInfo(),
387  managedOutputGateBias.Map()));
388  }
389 
390  // Add cifig parameters
392  {
393  constTensors.emplace_back(ConstTensor(managedInputToInputWeights.GetTensorInfo(),
394  managedInputToInputWeights.Map()));
395  }
397  {
398  constTensors.emplace_back(ConstTensor(
399  managedRecurrentToInputWeights.GetTensorInfo(),
400  managedRecurrentToInputWeights.Map()));
401  }
402  if (m_CifgParameters.m_InputGateBias != nullptr)
403  {
404  constTensors.emplace_back(ConstTensor(managedInputGateBias.GetTensorInfo(),
405  managedInputGateBias.Map()));
406  }
407 
408  // Add peephole parameters
410  {
411  constTensors.emplace_back(ConstTensor(managedCellToInputWeights.GetTensorInfo(),
412  managedCellToInputWeights.Map()));
413  }
415  {
416  constTensors.emplace_back(ConstTensor(managedCellToForgetWeights.GetTensorInfo(),
417  managedCellToForgetWeights.Map()));
418  }
420  {
421  constTensors.emplace_back(ConstTensor(managedCellToOutputWeights.GetTensorInfo(),
422  managedCellToOutputWeights.Map()));
423  }
424 
425  // Add projection parameters
427  {
428  constTensors.emplace_back(ConstTensor(managedProjectionWeights.GetTensorInfo(),
429  managedProjectionWeights.Map()));
430  }
432  {
433  constTensors.emplace_back(ConstTensor(managedProjectionBias.GetTensorInfo(),
434  managedProjectionBias.Map()));
435  }
436 
437  // Add norm parameters
439  {
440  constTensors.emplace_back(ConstTensor(managedInputLayerNormWeights.GetTensorInfo(),
441  managedInputLayerNormWeights.Map()));
442  }
444  {
445  constTensors.emplace_back(ConstTensor(managedForgetLayerNormWeights.GetTensorInfo(),
446  managedForgetLayerNormWeights.Map()));
447  }
449  {
450  constTensors.emplace_back(ConstTensor(managedCellLayerNormWeights.GetTensorInfo(),
451  managedCellLayerNormWeights.Map()));
452  }
454  {
455  constTensors.emplace_back(ConstTensor(managedOutputLayerNormWeights.GetTensorInfo(),
456  managedOutputLayerNormWeights.Map()));
457  }
458  strategy.ExecuteStrategy(this, GetParameters(), constTensors, GetName());
459 }
460 
461 } // namespace armnn
ARMNN_ASSERT
#define ARMNN_ASSERT(COND)
Definition: Assert.hpp:14
armnn::QLstmLayer::m_CifgParameters
QLstmOptCifgParameters m_CifgParameters
Definition: QLstmLayer.hpp:84
armnn::QLstmOptPeepholeParameters::m_CellToForgetWeights
std::shared_ptr< ConstTensorHandle > m_CellToForgetWeights
A unique pointer to represent 1D weights tensor with dimensions [num_units] (QSymmS16).
Definition: QLstmLayer.hpp:51
armnn::QLstmDescriptor
A QLstmDescriptor for the QLstmLayer.
Definition: Descriptors.hpp:1380
armnn::QLstmBasicParameters::m_ForgetGateBias
std::shared_ptr< ConstTensorHandle > m_ForgetGateBias
A unique pointer to represent 1D bias tensor with dimensions [num_units] (int32).
Definition: QLstmLayer.hpp:31
armnn::QLstmDescriptor::m_ProjectionEnabled
bool m_ProjectionEnabled
Enable/disable the projection layer.
Definition: Descriptors.hpp:1422
armnn::QLstmLayer
This layer represents a QLstm operation.
Definition: QLstmLayer.hpp:79
armnn::OutputSlot::GetTensorInfo
const TensorInfo & GetTensorInfo() const override
Definition: Layer.cpp:92
armnn::QLstmQueueDescriptor::m_InputToForgetWeights
const ConstTensorHandle * m_InputToForgetWeights
Definition: WorkloadData.hpp:590
armnn::QLstmOptLayerNormParameters::m_ForgetLayerNormWeights
std::shared_ptr< ConstTensorHandle > m_ForgetLayerNormWeights
A unique pointer to represent 1D weights tensor with dimensions [num_units] (QSymmS16).
Definition: QLstmLayer.hpp:71
armnn::QLstmQueueDescriptor::m_InputLayerNormWeights
const ConstTensorHandle * m_InputLayerNormWeights
Definition: WorkloadData.hpp:606
TypesUtils.hpp
armnn::QLstmLayer::QLstmLayer
QLstmLayer(const QLstmDescriptor &param, const char *name)
Constructor to create a QLstmLayer.
Definition: QLstmLayer.cpp:17
armnn::QLstmLayer::Clone
QLstmLayer * Clone(Graph &graph) const override
Creates a dynamically-allocated copy of this layer.
Definition: QLstmLayer.cpp:81
CHECK_LOCATION
#define CHECK_LOCATION()
Definition: Exceptions.hpp:203
armnn::QLstmOptPeepholeParameters::m_CellToOutputWeights
std::shared_ptr< ConstTensorHandle > m_CellToOutputWeights
A unique pointer to represent 1D weights tensor with dimensions [num_units] (QSymmS16).
Definition: QLstmLayer.hpp:53
armnn::Layer::ValidateAndCopyShape
void ValidateAndCopyShape(const TensorShape &outputShape, const TensorShape &inferredShape, const ShapeInferenceMethod shapeInferenceMethod, const std::string &layerName, const unsigned int outputSlotIndex=0)
Definition: Layer.cpp:435
armnn::QLstmOptLayerNormParameters::m_OutputLayerNormWeights
std::shared_ptr< ConstTensorHandle > m_OutputLayerNormWeights
A unique pointer to represent 1D weights tensor with dimensions [num_units] (QSymmS16).
Definition: QLstmLayer.hpp:75
armnn::Layer::GetOutputSlot
const OutputSlot & GetOutputSlot(unsigned int index=0) const override
Get the const output slot handle by slot index.
Definition: Layer.hpp:339
armnn::QLstmQueueDescriptor::m_InputToInputWeights
const ConstTensorHandle * m_InputToInputWeights
Definition: WorkloadData.hpp:589
armnn::IStrategy
Definition: IStrategy.hpp:16
ARMNN_ASSERT_MSG
#define ARMNN_ASSERT_MSG(COND, MSG)
Definition: Assert.hpp:15
armnn::ManagedConstTensorHandle
Definition: TensorHandle.hpp:187
armnn::Layer::GetInputSlot
const InputSlot & GetInputSlot(unsigned int index) const override
Get a const input slot handle by slot index.
Definition: Layer.hpp:337
armnn::LayerWithParameters< QLstmDescriptor >::GetParameters
const QLstmDescriptor & GetParameters() const override
Definition: LayerWithParameters.hpp:19
WorkloadFactory.hpp
armnn::LayerWithParameters
Definition: LayerWithParameters.hpp:14
armnn::QLstmQueueDescriptor::m_ProjectionWeights
const ConstTensorHandle * m_ProjectionWeights
Definition: WorkloadData.hpp:604
armnn::QLstmOptProjectionParameters::m_ProjectionWeights
std::shared_ptr< ConstTensorHandle > m_ProjectionWeights
A unique pointer to represent 2D weights tensor with dimensions [output_size, num_units] (QSymmS8).
Definition: QLstmLayer.hpp:41
armnn::QLstmQueueDescriptor::m_ForgetLayerNormWeights
const ConstTensorHandle * m_ForgetLayerNormWeights
Definition: WorkloadData.hpp:607
armnn::Layer::GetName
const char * GetName() const override
Returns the name of the layer.
Definition: Layer.hpp:332
armnn::QLstmQueueDescriptor::m_RecurrentToOutputWeights
const ConstTensorHandle * m_RecurrentToOutputWeights
Definition: WorkloadData.hpp:596
armnn::QLstmOptLayerNormParameters::m_CellLayerNormWeights
std::shared_ptr< ConstTensorHandle > m_CellLayerNormWeights
A unique pointer to represent 1D weights tensor with dimensions [num_units] (QSymmS16).
Definition: QLstmLayer.hpp:73
armnn::IConnectableLayer::ImmutableConstantTensors
std::vector< std::reference_wrapper< const std::shared_ptr< ConstTensorHandle > >> ImmutableConstantTensors
Definition: INetwork.hpp:141
armnn::InputSlot::GetTensorInfo
const TensorInfo & GetTensorInfo() const override
Gets the TensorInfo for this InputSlot.
Definition: Layer.cpp:592
armnn::TensorShape
Definition: Tensor.hpp:20
LstmParams.hpp
armnn::QLstmQueueDescriptor::m_CellToOutputWeights
const ConstTensorHandle * m_CellToOutputWeights
Definition: WorkloadData.hpp:599
armnn::LayerWithParameters< QLstmDescriptor >::m_Param
QLstmDescriptor m_Param
The parameters for the layer (not including tensor-valued weights etc.).
Definition: LayerWithParameters.hpp:52
armnn::QLstmQueueDescriptor::m_CellToForgetWeights
const ConstTensorHandle * m_CellToForgetWeights
Definition: WorkloadData.hpp:598
armnn::QLstmOptPeepholeParameters::m_CellToInputWeights
std::shared_ptr< ConstTensorHandle > m_CellToInputWeights
A unique pointer to represent 1D weights tensor with dimensions [num_units] (QSymmS16).
Definition: QLstmLayer.hpp:49
armnn::LayerWithParameters< QLstmDescriptor >::PrepInfoAndDesc
WorkloadInfo PrepInfoAndDesc(QueueDescriptor &descriptor) const
Helper function to reduce duplication in *Layer::CreateWorkload.
Definition: LayerWithParameters.hpp:44
armnn::QLstmLayer::CreateWorkload
virtual std::unique_ptr< IWorkload > CreateWorkload(const IWorkloadFactory &factory) const override
Makes a workload for the QLstm type.
Definition: QLstmLayer.cpp:22
armnn::IWorkloadFactory
Definition: WorkloadFactory.hpp:22
armnn::QLstmQueueDescriptor::m_OutputLayerNormWeights
const ConstTensorHandle * m_OutputLayerNormWeights
Definition: WorkloadData.hpp:609
armnn::QLstmQueueDescriptor::m_InputGateBias
const ConstTensorHandle * m_InputGateBias
Definition: WorkloadData.hpp:600
armnn::QLstmQueueDescriptor::m_OutputGateBias
const ConstTensorHandle * m_OutputGateBias
Definition: WorkloadData.hpp:603
QLstmLayer.hpp
armnn::QLstmOptCifgParameters::m_RecurrentToInputWeights
std::shared_ptr< ConstTensorHandle > m_RecurrentToInputWeights
A unique pointer to represent 2D weights tensor with dimensions [input_size, num_units] (QSymmS8).
Definition: QLstmLayer.hpp:61
armnn::Layer::VerifyShapeInferenceType
void VerifyShapeInferenceType(const TensorShape &outputShape, ShapeInferenceMethod shapeInferenceMethod)
Definition: Layer.cpp:504
armnn::GetTensorInfo
const TensorInfo & GetTensorInfo(const ITensorHandle *tensorHandle)
float32 helpers
Definition: RefWorkloadUtils.hpp:33
armnn::ManagedConstTensorHandle::Map
const void * Map(bool blocking=true)
RAII Managed resource Unmaps MemoryArea once out of scope.
Definition: TensorHandle.hpp:196
armnn::QLstmQueueDescriptor::m_ForgetGateBias
const ConstTensorHandle * m_ForgetGateBias
Definition: WorkloadData.hpp:601
armnn::Layer::SetAdditionalInfo
void SetAdditionalInfo(QueueDescriptor &descriptor) const
Definition: Layer.cpp:287
armnn::QLstmQueueDescriptor
Definition: WorkloadData.hpp:562
armnn::QLstmQueueDescriptor::m_RecurrentToInputWeights
const ConstTensorHandle * m_RecurrentToInputWeights
Definition: WorkloadData.hpp:593
armnn::QLstmOptCifgParameters::m_InputGateBias
std::shared_ptr< ConstTensorHandle > m_InputGateBias
A unique pointer to represent 1D weights tensor with dimensions [num_units] (int32).
Definition: QLstmLayer.hpp:63
armnn::QLstmOptLayerNormParameters::m_InputLayerNormWeights
std::shared_ptr< ConstTensorHandle > m_InputLayerNormWeights
A unique pointer to represent 1D weights tensor with dimensions [num_units] (QSymmS16).
Definition: QLstmLayer.hpp:69
armnn::QLstmLayer::ExecuteStrategy
void ExecuteStrategy(IStrategy &strategy) const override
Apply a visitor to this layer.
Definition: QLstmLayer.cpp:307
armnn::QLstmQueueDescriptor::m_RecurrentToForgetWeights
const ConstTensorHandle * m_RecurrentToForgetWeights
Definition: WorkloadData.hpp:594
armnn::QLstmLayer::GetConstantTensorsByRef
Layer::ImmutableConstantTensors GetConstantTensorsByRef() const override
Retrieve the handles to the constant values stored by the layer.
Definition: QLstmLayer.cpp:272
armnn::QLstmLayer::m_LayerNormParameters
QLstmOptLayerNormParameters m_LayerNormParameters
Definition: QLstmLayer.hpp:87
armnn::QLstmBasicParameters::m_RecurrentToOutputWeights
std::shared_ptr< ConstTensorHandle > m_RecurrentToOutputWeights
A unique pointer to represent 2D weights tensor with dimensions [num_units, outputSize] (QSymmS8).
Definition: QLstmLayer.hpp:28
TensorHandle.hpp
armnn::QLstmQueueDescriptor::m_InputToOutputWeights
const ConstTensorHandle * m_InputToOutputWeights
Definition: WorkloadData.hpp:592
armnn::QLstmLayer::m_PeepholeParameters
QLstmOptPeepholeParameters m_PeepholeParameters
Definition: QLstmLayer.hpp:86
armnn::TensorInfo::GetShape
const TensorShape & GetShape() const
Definition: Tensor.hpp:193
armnn::QLstmBasicParameters::m_CellBias
std::shared_ptr< ConstTensorHandle > m_CellBias
A unique pointer to represent 1D bias tensor with dimensions [num_units] (int32).
Definition: QLstmLayer.hpp:33
armnn::QLstmBasicParameters::m_OutputGateBias
std::shared_ptr< ConstTensorHandle > m_OutputGateBias
A unique pointer to represent 1D bias tensor with dimensions [num_units] (int32).
Definition: QLstmLayer.hpp:35
armnn::QLstmBasicParameters::m_RecurrentToCellWeights
std::shared_ptr< ConstTensorHandle > m_RecurrentToCellWeights
A unique pointer to represent 2D weights tensor with dimensions [num_units, outputSize] (QSymmS8).
Definition: QLstmLayer.hpp:26
armnn::QLstmDescriptor::m_CifgEnabled
bool m_CifgEnabled
Enable/disable CIFG (coupled input & forget gate).
Definition: Descriptors.hpp:1418
armnn::QLstmOptCifgParameters::m_InputToInputWeights
std::shared_ptr< ConstTensorHandle > m_InputToInputWeights
A unique pointer to represent 2D weights tensor with dimensions [input_size, num_units] (QSymmS8).
Definition: QLstmLayer.hpp:59
armnn::QLstmLayer::ValidateTensorShapesFromInputs
void ValidateTensorShapesFromInputs() override
Check if the input tensor shape(s) will lead to a valid configuration of QLstmLayer.
Definition: QLstmLayer.cpp:170
armnn
Copyright (c) 2021 ARM Limited and Contributors.
Definition: 01_00_quick_start.dox:6
armnn::QLstmLayer::m_ProjectionParameters
QLstmOptProjectionParameters m_ProjectionParameters
Definition: QLstmLayer.hpp:85
armnn::QLstmLayer::InferOutputShapes
std::vector< TensorShape > InferOutputShapes(const std::vector< TensorShape > &inputShapes) const override
By default returns inputShapes if the number of inputs are equal to number of outputs,...
Definition: QLstmLayer.cpp:153
armnn::ConstTensor
A tensor defined by a TensorInfo (shape and data type) and an immutable backing store.
Definition: Tensor.hpp:329
armnn::Layer::VerifyLayerConnections
void VerifyLayerConnections(unsigned int expectedConnections, const CheckLocation &location) const
Definition: Layer.cpp:391
armnn::QLstmBasicParameters::m_RecurrentToForgetWeights
std::shared_ptr< ConstTensorHandle > m_RecurrentToForgetWeights
A unique pointer to represent 2D weights tensor with dimensions [num_units, outputSize] (QSymmS8).
Definition: QLstmLayer.hpp:24
armnn::QLstmQueueDescriptor::m_ProjectionBias
const ConstTensorHandle * m_ProjectionBias
Definition: WorkloadData.hpp:605
armnn::QLstmQueueDescriptor::m_CellToInputWeights
const ConstTensorHandle * m_CellToInputWeights
Definition: WorkloadData.hpp:597
armnn::QLstmDescriptor::m_LayerNormEnabled
bool m_LayerNormEnabled
Enable/disable layer normalization.
Definition: Descriptors.hpp:1424
armnn::QLstmOptProjectionParameters::m_ProjectionBias
std::shared_ptr< ConstTensorHandle > m_ProjectionBias
A unique pointer to represent 1D weights tensor with dimensions [output_size] (int32).
Definition: QLstmLayer.hpp:43
armnn::QLstmQueueDescriptor::m_CellBias
const ConstTensorHandle * m_CellBias
Definition: WorkloadData.hpp:602
armnn::QLstmLayer::m_BasicParameters
QLstmBasicParameters m_BasicParameters
Definition: QLstmLayer.hpp:83
armnn::QLstmQueueDescriptor::m_InputToCellWeights
const ConstTensorHandle * m_InputToCellWeights
Definition: WorkloadData.hpp:591
armnn::Layer::m_ShapeInferenceMethod
ShapeInferenceMethod m_ShapeInferenceMethod
Definition: Layer.hpp:441
armnn::LayerType
LayerType
When adding a new layer, adapt also the LastLayer enum value in the enum class LayerType below.
Definition: Types.hpp:491
armnn::QLstmBasicParameters::m_InputToOutputWeights
std::shared_ptr< ConstTensorHandle > m_InputToOutputWeights
A unique pointer to represent 2D weights tensor with dimensions [num_units, inputSize] (QSymmS8).
Definition: QLstmLayer.hpp:21
armnn::QLstmDescriptor::m_PeepholeEnabled
bool m_PeepholeEnabled
Enable/disable peephole.
Definition: Descriptors.hpp:1420
armnn::Graph
Definition: Graph.hpp:30
armnn::LayerType::QLstm
@ QLstm
armnn::IWorkloadFactory::CreateWorkload
virtual std::unique_ptr< IWorkload > CreateWorkload(LayerType type, const QueueDescriptor &descriptor, const WorkloadInfo &info) const =0
Backends should implement their own CreateWorkload function with a switch statement.
armnn::IStrategy::ExecuteStrategy
virtual void ExecuteStrategy(const IConnectableLayer *layer, const armnn::BaseDescriptor &descriptor, const std::vector< armnn::ConstTensor > &constants, const char *name, const armnn::LayerBindingId id=0)=0
armnn::QLstmQueueDescriptor::m_CellLayerNormWeights
const ConstTensorHandle * m_CellLayerNormWeights
Definition: WorkloadData.hpp:608
armnn::QLstmBasicParameters::m_InputToForgetWeights
std::shared_ptr< ConstTensorHandle > m_InputToForgetWeights
A unique pointer to represent 2D weights tensor with dimensions [num_units, inputSize] (QSymmS8).
Definition: QLstmLayer.hpp:17
LayerCloneBase.hpp
armnn::QLstmQueueDescriptor::m_RecurrentToCellWeights
const ConstTensorHandle * m_RecurrentToCellWeights
Definition: WorkloadData.hpp:595
armnn::ManagedConstTensorHandle::GetTensorInfo
const TensorInfo & GetTensorInfo() const
Definition: TensorHandle.hpp:239
armnn::QLstmBasicParameters::m_InputToCellWeights
std::shared_ptr< ConstTensorHandle > m_InputToCellWeights
A unique pointer to represent 2D weights tensor with dimensions [num_units, inputSize] (QSymmS8).
Definition: QLstmLayer.hpp:19