[loco] support DepthwiseConv2D of TypeForwardAlgorithm (#6404)
author채성우/On-Device Lab(SR)/Engineer/삼성전자 <sw4670.chae@samsung.com>
Fri, 9 Aug 2019 06:06:29 +0000 (15:06 +0900)
committer박세희/On-Device Lab(SR)/Principal Engineer/삼성전자 <saehie.park@samsung.com>
Fri, 9 Aug 2019 06:06:29 +0000 (15:06 +0900)
This commit is to support DepthwiseConv2D and DepthwiseFilterEncode in
CanonicalTypeForwardAlgorithm.

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

index 3c18cb3..40d77b2 100644 (file)
@@ -98,8 +98,11 @@ struct CanonicalTypeForwardAlgorithm final : public loco::CanonicalNodeVisitor<l
   loco::DataType visit(const loco::BiasEncode *node) { return loco::dtype_get(node->input()); }
   loco::DataType visit(const loco::ConstGen *node) { return node->dtype(); }
   loco::DataType visit(const loco::Conv2D *node) { return loco::dtype_get(node->ifm()); }
-  // TODO Support DepthwiseConv2D
-  // TODO Support DepthwiseFilterEncode
+  loco::DataType visit(const loco::DepthwiseConv2D *node) { return loco::dtype_get(node->ifm()); }
+  loco::DataType visit(const loco::DepthwiseFilterEncode *node)
+  {
+    return loco::dtype_get(node->input());
+  }
   loco::DataType visit(const loco::EltwiseAdd *node) { return loco::dtype_get(node->lhs()); }
   loco::DataType visit(const loco::EltwiseDiv *node) { return loco::dtype_get(node->lhs()); }
   loco::DataType visit(const loco::EltwiseMul *node) { return loco::dtype_get(node->lhs()); }