[enco] Build ANN IR from PadF Op tree (#1827)
author박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Thu, 11 Oct 2018 04:44:24 +0000 (13:44 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Thu, 11 Oct 2018 04:44:24 +0000 (13:44 +0900)
With this commit, ANNOpBuilder is now able to build ANN IR from PadF Op
tree.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
contrib/enco/core/src/Transforms/Split.cpp

index 8304452..31050f0 100644 (file)
@@ -567,6 +567,29 @@ public:
         }
       }
     }
+    else if (auto op = eval->op()->asPadF())
+    {
+      if (auto load = op->arg()->asLoad())
+      {
+        // Let's compile the following code fragment:
+        //
+        //   %ofm = eval(PadF(Load(%ifm))
+        //
+        auto ifm = load->object()->asFeature();
+        auto ofm = eval->out()->asFeature();
+
+        assert(ifm != nullptr && ofm != nullptr);
+
+        auto app = make_unique<ANNPadFAppender>();
+
+        app->pad(op->pad());
+
+        app->ifm(ifm);
+        app->ofm(ofm);
+
+        return std::move(app);
+      }
+    }
     else if (auto relu = eval->op()->asReLU())
     {
       if (auto load = relu->arg()->asLoad())