aboutsummaryrefslogtreecommitdiff
path: root/src/armnn/layers/LstmParameters.hpp
blob: 3809ea875fdb0fd8cd47bd90829eca5854c71a35 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
//
// Copyright © 2021 Arm Ltd and Contributors. All rights reserved.
// SPDX-License-Identifier: MIT
//
#pragma once

#include "LayerWithParameters.hpp"

namespace armnn
{

class ScopedTensorHandle;

struct LstmOptLayerNormParameters
{
    /// A unique pointer to represent 1D weights tensor with dimensions [num_units].
    std::shared_ptr<ConstTensorHandle> m_InputLayerNormWeights;
    /// A unique pointer to represent 1D weights tensor with dimensions [num_units].
    std::shared_ptr<ConstTensorHandle> m_ForgetLayerNormWeights;
    /// A unique pointer to represent 1D weights tensor with dimensions [num_units].
    std::shared_ptr<ConstTensorHandle> m_CellLayerNormWeights;
    /// A unique pointer to represent 1D weights tensor with dimensions [num_units].
    std::shared_ptr<ConstTensorHandle> m_OutputLayerNormWeights;
};

struct LstmOptCifgParameters
{
    /// A unique pointer to represent 2D weights tensor with dimensions [input_size, num_units].
    std::shared_ptr<ConstTensorHandle> m_InputToInputWeights;
    /// A unique pointer to represent 2D weights tensor with dimensions [input_size, num_units].
    std::shared_ptr<ConstTensorHandle> m_RecurrentToInputWeights;
    /// A unique pointer to represent 1D weights tensor with dimensions [num_units].
    std::shared_ptr<ConstTensorHandle> m_InputGateBias;
};

struct LstmOptProjectionParameters
{
    /// A unique pointer to represent 2D weights tensor with dimensions [output_size, num_units].
    std::shared_ptr<ConstTensorHandle> m_ProjectionWeights;
    /// A unique pointer to represent 1D weights tensor with dimensions [output_size].
    std::shared_ptr<ConstTensorHandle> m_ProjectionBias;
};

struct LstmOptPeepholeParameters
{
    /// A unique pointer to represent 1D weights tensor with dimensions [num_units].
    std::shared_ptr<ConstTensorHandle> m_CellToInputWeights;
    /// A unique pointer to represent 1D weights tensor with dimensions [num_units].
    std::shared_ptr<ConstTensorHandle> m_CellToForgetWeights;
    /// A unique pointer to represent 1D weights tensor with dimensions [num_units].
    std::shared_ptr<ConstTensorHandle> m_CellToOutputWeights;
};

struct LstmBasicParameters
{
    /// A unique pointer to represent 2D weights tensor with dimensions [input_size, num_units].
    std::shared_ptr<ConstTensorHandle> m_InputToForgetWeights;
    /// A unique pointer to represent 2D weights tensor with dimensions [input_size, num_units].
    std::shared_ptr<ConstTensorHandle> m_InputToCellWeights;
    /// A unique pointer to represent 2D weights tensor with dimensions [input_size, num_units].
    std::shared_ptr<ConstTensorHandle> m_InputToOutputWeights;
    /// A unique pointer to represent 2D weights tensor with dimensions [output_size, num_units].
    std::shared_ptr<ConstTensorHandle> m_RecurrentToForgetWeights;
    /// A unique pointer to represent 2D weights tensor with dimensions [output_size, num_units].
    std::shared_ptr<ConstTensorHandle> m_RecurrentToCellWeights;
    /// A unique pointer to represent 2D weights tensor with dimensions [output_size, num_units].
    std::shared_ptr<ConstTensorHandle> m_RecurrentToOutputWeights;
    /// A unique pointer to represent 1D weights tensor with dimensions [num_units].
    std::shared_ptr<ConstTensorHandle> m_ForgetGateBias;
    /// A unique pointer to represent 1D weights tensor with dimensions [num_units].
    std::shared_ptr<ConstTensorHandle> m_CellBias;
    /// A unique pointer to represent 1D weights tensor with dimensions [num_units].
    std::shared_ptr<ConstTensorHandle> m_OutputGateBias;
};

} // namespace