Fix IrNode to actually call visitor->visit() (#574)
authorVladimir Plazun/AI Tools Lab /SRR/Engineer/삼성전자 <v.plazun@partner.samsung.com>
Tue, 10 Jul 2018 10:55:38 +0000 (13:55 +0300)
committerSergey Vostokov/AI Tools Lab /SRR/Staff Engineer/삼성전자 <s.vostokov@samsung.com>
Tue, 10 Jul 2018 10:55:38 +0000 (19:55 +0900)
Previously disabled due to missing visitor operation acceptors

Signed-off-by: Vladimir Plazun <v.plazun@partner.samsung.com>
contrib/nnc/libs/core/include/nnc/core/IR/model/graph/ir_node.h
contrib/nnc/libs/core/src/core/IR/model/graph/ir_node.test.cpp

index 33760c4..b9e3a47 100644 (file)
@@ -112,8 +112,7 @@ public:
 
   void accept(Visitor *v) override
   {
-    //TODO: enable this when at least one Visitor operation declared
-    // v->visit(this, *static_cast<OpType*>(_props.op));
+     v->visit(this, *static_cast<OpType*>(_props.op));
   }
 
   ~Node() override {
index cd0f857..ec52cd5 100644 (file)
@@ -1,21 +1,15 @@
 #include "nnc/core/IR/model/operations/operation.h"
+#include "nnc/core/IR/model/operations/reshape_op.h"
 #include "nnc/core/IR/model/graph/ir_node.h"
 #include "nncc/core/ADT/feature/Shape.h"
 
-
 #include <gtest/gtest.h>
 
-
-class DummyOperation : public nncc::contrib::core::IR::model::OpDescription {
- public:
-  DummyOperation() : OpDescription(1, 1) {}
-};
-
 TEST(IRNode, ConnectionTest) {
   using namespace nncc::contrib::core::IR::model;
 
-  auto node1 = Node<DummyOperation>::createNode("node1", 0);
-  auto node2 = Node<DummyOperation>::createNode("node2", 1);
+  auto node1 = Node<ops::ReshapeOp>::createNode("node1", 0);
+  auto node2 = Node<ops::ReshapeOp>::createNode("node2", 1);
 
   node2->connectInputTo(0, node1->getOutput(0));