Inference shape in codegen (#674)
authorEfimov Alexander/AI Tools Lab/./Samsung Electronics <a.efimov@samsung.com>
Mon, 16 Jul 2018 17:17:25 +0000 (20:17 +0300)
committerSergey Vostokov/AI Tools Lab /SRR/Staff Engineer/삼성전자 <s.vostokov@samsung.com>
Mon, 16 Jul 2018 17:17:25 +0000 (02:17 +0900)
Add shape inference in codegen

Signed-off-by: Efimov Alexander <a.efimov@samsung.com>
contrib/nnc/libs/backend/soft/src/generator.cpp

index aa4a4f3..9254051 100644 (file)
@@ -1,6 +1,7 @@
 #include "generator.h"
 #include "model_analyzer.h"
 #include "PluginException.h"
+#include "nnc/core/IR/model/actions/ShapeInference.h"
 
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -144,6 +145,9 @@ void BaseCodeGenerator::materializeModelParams(ostream &out, const ModelAnalyzer
 
 void BaseCodeGenerator::generate(Graph *g)
 {
+  // inference shapes
+  core::IR::model::ShapeInference si;
+  g->accept(&si);
   // visit and analyze graph
   ModelAnalyzer ma;
   g->accept(&ma);