[IE][VPU]: Enables check of parameters count for LSTMCell (#2335)
authorEvgeny Latkin <evgeny.latkin@intel.com>
Tue, 22 Sep 2020 09:06:25 +0000 (12:06 +0300)
committerGitHub <noreply@github.com>
Tue, 22 Sep 2020 09:06:25 +0000 (12:06 +0300)
inference-engine/cmake/vpu_dependencies.cmake
inference-engine/src/vpu/graph_transformer/src/stages/rnn.cpp

index d0c55448e2583e9ef191a1ba3edf8ce74b2c1282..3903f8a707926847402cc1b01bd66b2a6ca9ba49 100644 (file)
@@ -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")
 
 #
index 47ae11c4b5048f11ae7e2ce250cee867b1c39c3c..e108a0eeaa2f95dff501e2a7cfee92a81d20614d 100644 (file)
@@ -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);
         }