[exo] type and shape inference for Relu6 (#8171)
author윤현식/On-Device Lab(SR)/Principal Engineer/삼성전자 <hyunsik.yoon@samsung.com>
Tue, 15 Oct 2019 10:13:32 +0000 (19:13 +0900)
committer박종현/On-Device Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Tue, 15 Oct 2019 10:13:32 +0000 (19:13 +0900)
This adds type and shape inference for Relu6.

Signed-off-by: Hyun Sik Yoon <hyunsik.yoon@samsung.com>
compiler/exo/src/Dialect/Service/TFLShapeInferenceRule.cpp
compiler/exo/src/Dialect/Service/TFLTypeInferenceRule.cpp

index c4c155a..b42bc37 100644 (file)
@@ -305,7 +305,12 @@ public:
     return loco::NodeShape{input_shape};
   }
 
-  // TODO TFLRelu6
+  loco::NodeShape visit(const locoex::TFLRelu6 *node) final
+  {
+    auto input_shape = loco::shape_get(node->features()).as<loco::TensorShape>();
+
+    return loco::NodeShape{input_shape};
+  }
 
   // TODO TFLReshape
 
index cde801f..31d96be 100644 (file)
@@ -72,7 +72,10 @@ struct TypeInferenceAlgorithm final : public locoex::TFLNodeVisitor<loco::DataTy
     return loco::dtype_get(node->features());
   }
 
-  // TODO TFLRelu6
+  loco::DataType visit(const locoex::TFLRelu6 *node) final
+  {
+    return loco::dtype_get(node->features());
+  }
 
   // TODO TFLReshape