ArmNN
 25.02
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RefUnidirectionalSequenceLstmWorkload.hpp
Go to the documentation of this file.
1 //
2 // Copyright © 2022, 2024 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #pragma once
7 
8 #include <armnn/TypesUtils.hpp>
9 
10 #include "RefBaseWorkload.hpp"
12 
13 #include "Encoders.hpp"
14 #include "Decoders.hpp"
15 
16 namespace armnn
17 {
18 
19 class RefUnidirectionalSequenceLstmWorkload : public RefBaseWorkload<UnidirectionalSequenceLstmQueueDescriptor>
20 {
21 public:
23  const WorkloadInfo& info);
24 
25  void Execute() const override;
26 
27 private:
28  void Execute(std::vector<ITensorHandle*> inputs, std::vector<ITensorHandle*> outputs) const;
29  std::unique_ptr<ScopedTensorHandle> m_InputToInputWeightsTensor;
30  std::unique_ptr<ScopedTensorHandle> m_InputToForgetWeightsTensor;
31  std::unique_ptr<ScopedTensorHandle> m_InputToCellWeightsTensor;
32  std::unique_ptr<ScopedTensorHandle> m_InputToOutputWeightsTensor;
33  std::unique_ptr<ScopedTensorHandle> m_RecurrentToInputWeightsTensor;
34  std::unique_ptr<ScopedTensorHandle> m_RecurrentToForgetWeightsTensor;
35  std::unique_ptr<ScopedTensorHandle> m_RecurrentToCellWeightsTensor;
36  std::unique_ptr<ScopedTensorHandle> m_RecurrentToOutputWeightsTensor;
37  std::unique_ptr<ScopedTensorHandle> m_CellToInputWeightsTensor;
38  std::unique_ptr<ScopedTensorHandle> m_CellToForgetWeightsTensor;
39  std::unique_ptr<ScopedTensorHandle> m_CellToOutputWeightsTensor;
40  std::unique_ptr<ScopedTensorHandle> m_InputGateBiasTensor;
41  std::unique_ptr<ScopedTensorHandle> m_ForgetGateBiasTensor;
42  std::unique_ptr<ScopedTensorHandle> m_CellBiasTensor;
43  std::unique_ptr<ScopedTensorHandle> m_OutputGateBiasTensor;
44  std::unique_ptr<ScopedTensorHandle> m_ProjectionWeightsTensor;
45  std::unique_ptr<ScopedTensorHandle> m_ProjectionBiasTensor;
46  std::unique_ptr<ScopedTensorHandle> m_InputLayerNormWeights;
47  std::unique_ptr<ScopedTensorHandle> m_ForgetLayerNormWeights;
48  std::unique_ptr<ScopedTensorHandle> m_CellLayerNormWeights;
49  std::unique_ptr<ScopedTensorHandle> m_OutputLayerNormWeights;
50 
51  float m_LayerNormEpsilon = static_cast<float>(1e-8);
52 };
53 
54 } //namespace armnn
RefUnidirectionalSequenceLstmWorkload(const UnidirectionalSequenceLstmQueueDescriptor &descriptor, const WorkloadInfo &info)
Copyright (c) 2021 ARM Limited and Contributors.
Contains information about TensorInfos of a layer.