[split layer] Initialize class member bugfix
authorParichay Kapoor <pk.kapoor@samsung.com>
Mon, 14 Jun 2021 02:45:16 +0000 (11:45 +0900)
committerJijoong Moon <jijoong.moon@samsung.com>
Tue, 15 Jun 2021 05:49:07 +0000 (14:49 +0900)
Split layer has class member leading_helper_dim
which remains uninitialized and results in bugs
when setBatchSize() is called before initialization of the layer.

This patch fixes the bug.

**Self evaluation:**
1. Build test: [x]Passed [ ]Failed [ ]Skipped
2. Run test: [x]Passed [ ]Failed [ ]Skipped

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

index a18d3ad..c1e2fba 100644 (file)
@@ -34,7 +34,8 @@ public:
   template <typename... Args>
   SplitLayer(unsigned int split_dim = 1, Args... args) :
     Layer(args...),
-    split_dimension(split_dim) {}
+    split_dimension(split_dim),
+    leading_helper_dim(1) {}
 
   /**
    * @brief     Destructor of Split Layer