* [moco-tf] Using composed GraphBuilderRegistry for custom op
This is to use a composed GraphBuilderRegistry, instead of singleton GraphBuilderRegistry, to add GraphBuilder for custom op later.
Signed-off-by: Hyun Sik Yoon <hyunsik.yoon@samsung.com>
* enhance comment. rename function
}
}
+/**
+ * @brief Returns GraphBuilderRegistry that looks up default registry and additions
+ * such as custom op
+ */
+moco::tf::GraphBuilderRegistry make_graph_builder_registry(const moco::tf::ModelSignature &sig)
+{
+ moco::tf::GraphBuilderRegistry registry{&moco::tf::GraphBuilderRegistry::get()};
+
+ // TODO add GraphBuilder for Custom op into registry
+
+ return registry;
+}
+
} // namespace
// TODO Find a proper place for this function
std::unique_ptr<loco::Graph> Frontend::import(const ModelSignature &signature,
tensorflow::GraphDef &tf_graph_def) const
{
- Importer importer;
+ // Let's use GraphBuilderRegistry with COpCallGraphBuilder
+ GraphBuilderRegistry registry = make_graph_builder_registry(signature);
+
+ Importer importer{®istry};
auto graph = importer.import(signature, tf_graph_def);