From: DongHak Park Date: Fri, 14 Apr 2023 08:27:46 +0000 (+0900) Subject: [TFLite Export] Add variable, functions TfOpNodes for Fused OP export X-Git-Tag: accepted/tizen/8.0/unified/20231005.093407~74 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=94bcb624338ed9dc682928e1b12945c6d3183721;p=platform%2Fcore%2Fml%2Fnntrainer.git [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 --- 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++; } }