[coverity] fix coverity issue
authorDonghyeon Jeong <dhyeon.jeong@samsung.com>
Tue, 21 May 2024 00:38:00 +0000 (09:38 +0900)
committerJijoong Moon <jijoong.moon@samsung.com>
Wed, 22 May 2024 23:11:19 +0000 (08:11 +0900)
This PR resolves the coverity issue of the constructor may not initialize class members.

**Changes proposed in this PR:**
- initialize lora_idx and lora_scaling in class constructor.

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

Signed-off-by: Donghyeon Jeong <dhyeon.jeong@samsung.com>
nntrainer/layers/fc_layer.cpp

index de34f5f921118f565a2a94d7c772f22f233b0f1a..436a936439ebd2c77545833b5ddb810727f1391e 100644 (file)
@@ -40,8 +40,11 @@ enum FCParams { weight, bias };
 enum LORAParams { loraA, loraB, loraTmp, loraOut };
 
 FullyConnectedLayer::FullyConnectedLayer() :
-  LayerImpl(), fc_props(props::Unit(), props::LoraRank(), props::LoraAlpha()) {
+  LayerImpl(),
+  lora_scaling(1.0f),
+  fc_props(props::Unit(), props::LoraRank(), props::LoraAlpha()) {
   weight_idx.fill(std::numeric_limits<unsigned>::max());
+  lora_idx.fill(std::numeric_limits<unsigned>::max());
 }
 
 void FullyConnectedLayer::finalize(InitLayerContext &context) {