From 7858332a701f040cf57ba8302b53db5e59c1ec2e Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EC=9C=A4=ED=98=84=EC=8B=9D/On-Device=20Lab=28SR=29/Princip?= =?utf8?q?al=20Engineer/=EC=82=BC=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Tue, 15 Oct 2019 19:13:32 +0900 Subject: [PATCH] [exo] type and shape inference for Relu6 (#8171) This adds type and shape inference for Relu6. Signed-off-by: Hyun Sik Yoon --- compiler/exo/src/Dialect/Service/TFLShapeInferenceRule.cpp | 7 ++++++- compiler/exo/src/Dialect/Service/TFLTypeInferenceRule.cpp | 5 ++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/compiler/exo/src/Dialect/Service/TFLShapeInferenceRule.cpp b/compiler/exo/src/Dialect/Service/TFLShapeInferenceRule.cpp index c4c155a..b42bc37 100644 --- a/compiler/exo/src/Dialect/Service/TFLShapeInferenceRule.cpp +++ b/compiler/exo/src/Dialect/Service/TFLShapeInferenceRule.cpp @@ -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(); + + return loco::NodeShape{input_shape}; + } // TODO TFLReshape diff --git a/compiler/exo/src/Dialect/Service/TFLTypeInferenceRule.cpp b/compiler/exo/src/Dialect/Service/TFLTypeInferenceRule.cpp index cde801f..31d96be 100644 --- a/compiler/exo/src/Dialect/Service/TFLTypeInferenceRule.cpp +++ b/compiler/exo/src/Dialect/Service/TFLTypeInferenceRule.cpp @@ -72,7 +72,10 @@ struct TypeInferenceAlgorithm final : public locoex::TFLNodeVisitorfeatures()); } - // TODO TFLRelu6 + loco::DataType visit(const locoex::TFLRelu6 *node) final + { + return loco::dtype_get(node->features()); + } // TODO TFLReshape -- 2.7.4