[layer] LSTM weight array size fix
authorParichay Kapoor <pk.kapoor@samsung.com>
Fri, 25 Feb 2022 05:17:10 +0000 (14:17 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Fri, 25 Feb 2022 09:08:57 +0000 (18:08 +0900)
this patch adds LSTM weight array size fix.
The lstm layer requests 17 tensors to the tensor manager. However, lstm
layer only maintains an array of size 15 to store the index of the requested
tensors. This leads to an out of range access error.

This patch increases the size of the array to store the requested
tensors indices from 15 to 17.

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
nntrainer/layers/lstm.h

index e68369d..4c600b5 100644 (file)
@@ -115,7 +115,7 @@ private:
              props::RecurrentActivation, props::ReturnSequences,
              props::Bidirectional, props::DropOutRate, props::MaxTimestep>
     lstm_props;
-  std::array<unsigned int, 15> wt_idx; /**< indices of the weights */
+  std::array<unsigned int, 17> wt_idx; /**< indices of the weights */
 
   /**
    * @brief     activation function for h_t : default is tanh