From 171bf0fcc5d7b568a1e007d4c74b34951b0ec87e Mon Sep 17 00:00:00 2001 From: Evgeny Latkin Date: Tue, 22 Sep 2020 12:06:25 +0300 Subject: [PATCH] [IE][VPU]: Enables check of parameters count for LSTMCell (#2335) --- inference-engine/cmake/vpu_dependencies.cmake | 2 +- .../src/vpu/graph_transformer/src/stages/rnn.cpp | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/inference-engine/cmake/vpu_dependencies.cmake b/inference-engine/cmake/vpu_dependencies.cmake index d0c55448e..3903f8a70 100644 --- a/inference-engine/cmake/vpu_dependencies.cmake +++ b/inference-engine/cmake/vpu_dependencies.cmake @@ -19,7 +19,7 @@ set(VPU_SUPPORTED_FIRMWARES usb-ma2450 usb-ma2x8x pcie-ma248x) # Default packages # -set(FIRMWARE_PACKAGE_VERSION 1388) +set(FIRMWARE_PACKAGE_VERSION 1390) set(VPU_CLC_MA2X8X_VERSION "movi-cltools-20.09.1") # diff --git a/inference-engine/src/vpu/graph_transformer/src/stages/rnn.cpp b/inference-engine/src/vpu/graph_transformer/src/stages/rnn.cpp index 47ae11c4b..e108a0eea 100644 --- a/inference-engine/src/vpu/graph_transformer/src/stages/rnn.cpp +++ b/inference-engine/src/vpu/graph_transformer/src/stages/rnn.cpp @@ -83,6 +83,20 @@ private: bool useTempBuffer = (nCells > 1); IE_ASSERT((numTempBuffers() == 1 && useTempBuffer) || !useTempBuffer); + VPU_THROW_UNLESS(inputEdges().size() == 5, + "LSTMCell: input edges: {}, but expected: 5", + inputEdges().size()); + + // check number of outputs, without temp buffer + const int outputsNumber = outputEdges().size(); + const int useCellState = outputsNumber >= 2; + const int outputEdgesExpected = 1 + + (useCellState ? 1 : 0) + + (outputsNumber == 3 ? 1 : 0); + VPU_THROW_UNLESS(outputEdges().size() == outputEdgesExpected, + "LSTMCell: number of output edges: {}, but expected: {}", + outputEdges().size(), outputEdgesExpected); + for (const auto& inEdge : inputEdges()) { inEdge->input()->serializeBuffer(serializer); } -- 2.34.1