From 2ce579d950de941fc86f1f0161b03b421fffcfbb Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EC=9C=A4=ED=98=84=EC=8B=9D/=EB=8F=99=EC=9E=91=EC=A0=9C?= =?utf8?q?=EC=96=B4Lab=28SR=29/Principal=20Engineer/=EC=82=BC=EC=84=B1?= =?utf8?q?=EC=A0=84=EC=9E=90?= Date: Thu, 29 Nov 2018 14:50:41 +0900 Subject: [PATCH] [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 --- contrib/enco/frontend/tflite/src/Frontend.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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); -- 2.7.4