From: 윤현식/동작제어Lab(SR)/Principal Engineer/삼성전자 Date: Thu, 29 Nov 2018 05:50:41 +0000 (+0900) Subject: [enco/tfl/frontend] Creation of context ob outside of loop (#2442) X-Git-Tag: nncc_backup~1238 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2ce579d950de941fc86f1f0161b03b421fffcfbb;p=platform%2Fcore%2Fml%2Fnnfw.git [enco/tfl/frontend] Creation of context ob outside of loop (#2442) This commit moves creation of context ob outside of loop. (putting creation code inside loop creates same object over and over) Signed-off-by: Hyun Sik Yoon --- diff --git a/contrib/enco/frontend/tflite/src/Frontend.cpp b/contrib/enco/frontend/tflite/src/Frontend.cpp index 8f2953d..90620b3 100644 --- a/contrib/enco/frontend/tflite/src/Frontend.cpp +++ b/contrib/enco/frontend/tflite/src/Frontend.cpp @@ -117,14 +117,14 @@ enco::Bundle Frontend::load(void) const auto operators = graph->operators(); + tflimport::GraphBuilderContext opbuilder_context(m.get(), d.get(), blk, tensor_bags, + tensor_context, buffer_context, graph); + for (int i = 0; i < operators->Length(); ++i) { const auto *op = operators->Get(i); tflite::BuiltinOperator builtincode = opcode_context.builtin_code(op); - tflimport::GraphBuilderContext opbuilder_context(m.get(), d.get(), blk, tensor_bags, - tensor_context, buffer_context, graph); - if (const auto *graph_builder = tflimport::GraphBuilderRegistry::get().lookup(builtincode)) { graph_builder->build(op, &opbuilder_context);