[TFLite Export] Add Realized Path for Fused Op
authorDongHak Park <donghak.park@samsung.com>
Fri, 14 Apr 2023 08:35:07 +0000 (17:35 +0900)
committerJijoong Moon <jijoong.moon@samsung.com>
Mon, 21 Aug 2023 06:29:23 +0000 (15:29 +0900)
For Fused OP Made Realized Path

1. Check Trainable
 - check node is trainable or not for fusing
2. Conv + ReLU Fusing
3. Batch Normalization Fusing

Signed-off-by: DongHak Park <donghak.park@samsung.com>
nntrainer/compiler/tflite_opnode.cpp

index 8d989c0..1ad3a95 100644 (file)
@@ -125,15 +125,15 @@ void TfOpNode::setInputTransformFn(TransformFn fn) { input_transform = fn; }
 void TfOpNode::setWeights(Variables weights_) {
   unsigned int cnt = 0;
   for (auto &w : weights_) {
-    const unsigned int UNIT = w->batch();
-    const unsigned int CHANNEL = w->channel();
-    const unsigned int HEIGHT = w->height();
-    const unsigned int WIDTH = w->width();
+    const unsigned int unit = w->batch();
+    const unsigned int channel = w->channel();
+    const unsigned int height = w->height();
+    const unsigned int width = w->width();
 
     auto weight_data = weights.at(cnt)->getData();
     auto *ptr = const_cast<float *>(weight_data);
     memcpy(&ptr[0], &w->getData()[0],
-           sizeof(float) * (UNIT * CHANNEL * HEIGHT * WIDTH));
+           sizeof(float) * (unit * channel * height * width));
     cnt++;
   }
 }