[Coverity] Fix Coverity Issue
authorDonghak PARK <donghak.park@samsung.com>
Tue, 19 Sep 2023 08:33:12 +0000 (17:33 +0900)
committerJijoong Moon <jijoong.moon@samsung.com>
Thu, 21 Sep 2023 09:03:20 +0000 (18:03 +0900)
Remove local reference return
- it already removed at latest version but not yet merged in main branch

Signed-off-by: Donghak PARK <donghak.park@samsung.com>
nntrainer/layers/layer_context.h

index 9fc7abf..02dc08e 100644 (file)
@@ -403,18 +403,6 @@ public:
    * @return Tensor& Reference to the weight tensor
    */
   template <typename T = float> Tensor &getWeight(unsigned int idx) const {
-    if (weights[idx]->getDim().getDataType() == nntrainer::Tdatatype::QINT4 ||
-        weights[idx]->getDim().getDataType() == nntrainer::Tdatatype::QINT8) {
-      Tensor output(weights[idx]->getDim());
-
-      if (sizeof(T) == sizeof(float)) {
-        output.setDataType(nntrainer::Tdatatype::FP32);
-      } else {
-        output.setDataType(nntrainer::Tdatatype::FP16);
-      }
-
-      return weights[idx]->getVariableRef().dequantize<T>(output);
-    }
     return weights[idx]->getVariableRef();
   }