diff options
author | James Conroy <james.conroy@arm.com> | 2020-03-20 08:49:33 +0000 |
---|---|---|
committer | James Conroy <james.conroy@arm.com> | 2020-03-20 14:53:44 +0000 |
commit | 586a9aac99312eb9cb304cbbd18cec46b9158e23 (patch) | |
tree | 6d620eae6dcfb920ac04eae43424548dc602a1eb /include/armnn/Descriptors.hpp | |
parent | c94d3f7107b84b586791aa096f8641e6efa18c90 (diff) | |
download | armnn-586a9aac99312eb9cb304cbbd18cec46b9158e23.tar.gz |
IVGCVSW-4549 Add front end for new QLSTM layer
* Added new layer QLstm (Android R HAL 1.3)
* Made necessary updates to APIs
* Added unit tests
* This layer is functionally equivalent to the
original unquantized LSTM layer with some
additonal quantization features added. Due
to this, original LstmParams are used for
this layer.
Signed-off-by: James Conroy <james.conroy@arm.com>
Change-Id: I5b7f2d2fb6e17e81573b41a31bc55f49ae79608f
Diffstat (limited to 'include/armnn/Descriptors.hpp')
-rw-r--r-- | include/armnn/Descriptors.hpp | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/include/armnn/Descriptors.hpp b/include/armnn/Descriptors.hpp index 57917261d4..95eeaaa420 100644 --- a/include/armnn/Descriptors.hpp +++ b/include/armnn/Descriptors.hpp @@ -1083,6 +1083,66 @@ struct PreCompiledDescriptor unsigned int m_NumOutputSlots; }; +/// A QLstmDescriptor for the QLstmLayer. +struct QLstmDescriptor +{ + QLstmDescriptor() + : m_CellClip(0.0) + , m_ProjectionClip(0.0) + , m_CifgEnabled(true) + , m_PeepholeEnabled(false) + , m_ProjectionEnabled(false) + , m_LayerNormEnabled(false) + , m_InputIntermediateScale(0.0) + , m_ForgetIntermediateScale(0.0) + , m_CellIntermediateScale(0.0) + , m_OutputIntermediateScale(0.0) + , m_HiddenStateZeroPoint(0) + , m_HiddenStateScale(0.0) + {} + + bool operator ==(const QLstmDescriptor& rhs) const + { + return m_CellClip == rhs.m_CellClip && + m_ProjectionClip == rhs.m_ProjectionClip && + m_CifgEnabled == rhs.m_CifgEnabled && + m_PeepholeEnabled == rhs.m_PeepholeEnabled && + m_ProjectionEnabled == rhs.m_ProjectionEnabled && + m_LayerNormEnabled == rhs.m_LayerNormEnabled && + m_InputIntermediateScale == rhs.m_InputIntermediateScale && + m_ForgetIntermediateScale == rhs.m_ForgetIntermediateScale && + m_CellIntermediateScale == rhs.m_CellIntermediateScale && + m_OutputIntermediateScale == rhs.m_OutputIntermediateScale && + m_HiddenStateZeroPoint == rhs.m_HiddenStateZeroPoint && + m_HiddenStateScale == rhs.m_HiddenStateScale; + } + + /// Clipping threshold value for the cell state + float m_CellClip; + /// Clipping threshold value for the projection + float m_ProjectionClip; + /// Enable/disable CIFG (coupled input & forget gate). + bool m_CifgEnabled; + /// Enable/disable peephole + bool m_PeepholeEnabled; + /// Enable/disable the projection layer + bool m_ProjectionEnabled; + /// Enable/disable layer normalization + bool m_LayerNormEnabled; + /// Input intermediate quantization scale + float m_InputIntermediateScale; + /// Forget intermediate quantization scale + float m_ForgetIntermediateScale; + /// Cell intermediate quantization scale + float m_CellIntermediateScale; + /// Output intermediate quantization scale + float m_OutputIntermediateScale; + /// Hidden State zero point + int32_t m_HiddenStateZeroPoint; + /// Hidden State quantization scale + float m_HiddenStateScale; +}; + /// A TransposeConvolution2dDescriptor for the TransposeConvolution2dLayer. struct TransposeConvolution2dDescriptor { |