From 94bcb624338ed9dc682928e1b12945c6d3183721 Mon Sep 17 00:00:00 2001 From: DongHak Park Date: Fri, 14 Apr 2023 17:27:46 +0900 Subject: [PATCH] [TFLite Export] Add variable, functions TfOpNodes for Fused OP export for Export Tflite format with Fused Op add some Variable and Function 1. Add getter, setter, replace to weights - for Fused Op we need to adjust weights after made Opnode 2. Add isToBeRemove variable - After made Opnode, check condition and mark as to be remove 3. Add additional_props - for BatchNormalization Fused Op we need additional props from nntrainer - made vector variable for save additional data Signed-off-by: DongHak Park --- nntrainer/compiler/tflite_opnode.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/nntrainer/compiler/tflite_opnode.cpp b/nntrainer/compiler/tflite_opnode.cpp index 1ad3a95..8d989c0 100644 --- a/nntrainer/compiler/tflite_opnode.cpp +++ b/nntrainer/compiler/tflite_opnode.cpp @@ -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(weight_data); memcpy(&ptr[0], &w->getData()[0], - sizeof(float) * (unit * channel * height * width)); + sizeof(float) * (UNIT * CHANNEL * HEIGHT * WIDTH)); cnt++; } } -- 2.7.4