From 1bb911ca60f6e523dad0d29f6bef1d83f4e389eb Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EB=B0=95=EC=84=B8=ED=9D=AC/=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, 6 Dec 2018 18:37:58 +0900 Subject: [PATCH] [enco] frontend/caffe: Prepare to use GraphBuilder (#2538) This will add using GraphBuilderRegistry to prepare handling by each layer GraphBuilder Signed-off-by: SaeHie Park --- contrib/enco/frontend/caffe/src/Frontend.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/contrib/enco/frontend/caffe/src/Frontend.cpp b/contrib/enco/frontend/caffe/src/Frontend.cpp index e5e80cb..d6532d2 100644 --- a/contrib/enco/frontend/caffe/src/Frontend.cpp +++ b/contrib/enco/frontend/caffe/src/Frontend.cpp @@ -21,6 +21,7 @@ #include "IRBuilder.h" #include "Context.h" #include "Convert.h" +#include "GraphBuilderRegistry.h" #include #include @@ -122,7 +123,15 @@ enco::Bundle Frontend::load(void) const use(layer.bottom(n)); } - if (layer.type() == "Input") + caffeimport::GraphBuilderContext opbuilder_context(module.get(), data.get(), blk, shape_ctx, + bag_ctx, weight_ctx); + + if (const auto *graph_builder = caffeimport::GraphBuilderRegistry::get().lookup(layer.type())) + { + graph_builder->build(layer, &opbuilder_context); + } + // TODO move type handlers to separate builder + else if (layer.type() == "Input") { assert(layer.has_input_param()); const auto ¶m = layer.input_param(); -- 2.7.4