From a75905cb081c86a6b6b12b13aec25578ccd1802c Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EC=9C=A4=ED=98=84=EC=8B=9D/On-Device=20Lab=28SR=29/Princip?= =?utf8?q?al=20Engineer/=EC=82=BC=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Mon, 5 Aug 2019 09:15:28 +0900 Subject: [PATCH] [moco-tf] implementing make_graph_builder_registry(..) function (#6175) This adds `make_graph_builder_registry(..)` function, which makes graph builder registry that finds custom op graph builder and then searches into the default registry. Signed-off-by: Hyun Sik Yoon --- compiler/moco-tf/src/Frontend.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/compiler/moco-tf/src/Frontend.cpp b/compiler/moco-tf/src/Frontend.cpp index 75b1a69..d62b9c9 100644 --- a/compiler/moco-tf/src/Frontend.cpp +++ b/compiler/moco-tf/src/Frontend.cpp @@ -24,6 +24,8 @@ #include "Transforms.h" +#include "Op/COpCall.h" + #include #include @@ -108,7 +110,13 @@ moco::tf::GraphBuilderRegistry make_graph_builder_registry(const moco::tf::Model { moco::tf::GraphBuilderRegistry registry{&moco::tf::GraphBuilderRegistry::get()}; - // TODO add GraphBuilder for Custom op into registry + // build a COpCallGraphBuilder per custom op type + for (const auto &custom_op : sig.customops()) + { + std::unique_ptr builder = + stdex::make_unique(&sig); + registry.add(custom_op, std::move(builder)); + } return registry; } -- 2.7.4