From 586a9aac99312eb9cb304cbbd18cec46b9158e23 Mon Sep 17 00:00:00 2001 From: James Conroy Date: Fri, 20 Mar 2020 08:49:33 +0000 Subject: 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 Change-Id: I5b7f2d2fb6e17e81573b41a31bc55f49ae79608f --- src/armnn/test/ConstTensorLayerVisitor.hpp | 32 ++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'src/armnn/test/ConstTensorLayerVisitor.hpp') diff --git a/src/armnn/test/ConstTensorLayerVisitor.hpp b/src/armnn/test/ConstTensorLayerVisitor.hpp index 203c5fd91b..e423e0f6e3 100644 --- a/src/armnn/test/ConstTensorLayerVisitor.hpp +++ b/src/armnn/test/ConstTensorLayerVisitor.hpp @@ -221,6 +221,38 @@ private: LstmInputParams m_InputParams; }; +class TestQLstmLayerVisitor : public TestLayerVisitor +{ +public: + explicit TestQLstmLayerVisitor(const QLstmDescriptor& descriptor, + const LstmInputParams& params, + const char* name = nullptr) + : TestLayerVisitor(name) + , m_Descriptor(descriptor) + , m_InputParams(params) + {} + + void VisitQLstmLayer(const IConnectableLayer* layer, + const QLstmDescriptor& descriptor, + const LstmInputParams& params, + const char* name = nullptr) + { + CheckLayerPointer(layer); + CheckLayerName(name); + CheckDescriptor(descriptor); + CheckInputParameters(params); + } + +protected: + void CheckDescriptor(const QLstmDescriptor& descriptor); + void CheckInputParameters(const LstmInputParams& inputParams); + void CheckConstTensorPtrs(const std::string& name, const ConstTensor* expected, const ConstTensor* actual); + +private: + QLstmDescriptor m_Descriptor; + LstmInputParams m_InputParams; +}; + class TestQuantizedLstmLayerVisitor : public TestLayerVisitor { -- cgit v1.2.1