From: 윤현식/On-Device Lab(SR)/Principal Engineer/삼성전자 Date: Wed, 7 Aug 2019 05:52:28 +0000 (+0900) Subject: [exo-tflite] type inferencing including custom op (#6320) X-Git-Tag: submit/tizen/20190809.050447~80 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f58fde79deb8b788c7b536901ded9652a1ae9ed5;p=platform%2Fcore%2Fml%2Fnnfw.git [exo-tflite] type inferencing including custom op (#6320) This commit enables exo-tflite to infer type canonical nodes as well as custop op. Signed-off-by: Hyun Sik Yoon --- diff --git a/compiler/exo-tflite/src/TypeInference.cpp b/compiler/exo-tflite/src/TypeInference.cpp index 18c56a3..ebfef90 100644 --- a/compiler/exo-tflite/src/TypeInference.cpp +++ b/compiler/exo-tflite/src/TypeInference.cpp @@ -20,8 +20,12 @@ #include #include +#include #include +#include +#include + #include #include @@ -60,8 +64,15 @@ tflite::TensorType translateLocoTypeToTFLite(loco::DataType dtype) void TypeInference::run(loco::Graph *g) { - loco::CanonicalTypeInferenceRule rule; - loco::apply(&rule).to(g); + loco::CanonicalTypeInferenceRule canonical_rule; + locoex::COpTypeInferenceRule cop_rule; // rule for custom op + + loco::MultiDialectTypeInferenceRule rules; + + rules.bind(loco::CanonicalDialect::get(), &canonical_rule) + .bind(locoex::COpDialect::get(), &cop_rule); + + loco::apply(&rules).to(g); } tflite::TensorType TypeInference::get(loco::Node *node)