[loco] Introduce DepthwiseFilterEncode to CanonicalShapeInferenceRule (#6548)
author채성우/On-Device Lab(SR)/Engineer/삼성전자 <sw4670.chae@samsung.com>
Tue, 13 Aug 2019 10:18:46 +0000 (19:18 +0900)
committer박종현/On-Device Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Tue, 13 Aug 2019 10:18:46 +0000 (19:18 +0900)
This commit introduces DepthwiseFilterEncode to
CanonicalShapeInferenceRule.

Signed-off-by: seongwoo <sw4670.chae@samsung.com>
compiler/loco/src/Service/CanonicalShapeInferenceRule.cpp

index 78017a0..f5ca943 100644 (file)
@@ -237,7 +237,12 @@ public:
   }
 
   // TODO Support DepthwiseConv2D
-  // TODO Support DepthwiseFilterEncode
+  // CASE: DepthwiseFilterEncode
+  loco::NodeShape visit(const loco::DepthwiseFilterEncode *node) final
+  {
+    auto input_tensor_shape = loco::shape_get(node->input()).as<loco::TensorShape>();
+    return loco::NodeShape{node->encoder()->shape(input_tensor_shape)};
+  }
 
   // CASE: EltwiseAdd
   loco::NodeShape visit(const loco::EltwiseAdd *node) final