summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author윤현식/On-Device Lab(SR)/Principal Engineer/삼성전자 <hyunsik.yoon@samsung.com>2019-09-16 16:12:10 +0900
committer박종현/On-Device Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>2019-09-16 16:12:10 +0900
commit7a6ef8747a9672ebc51e54c1dad885d6981740cd (patch)
treed24bcdb3d0b25b6f92e032ad001f82360c58efef
parentb363925c38c87de3cbf665db5b954c61ea7ef293 (diff)
downloadnnfw-7a6ef8747a9672ebc51e54c1dad885d6981740cd.tar.gz
nnfw-7a6ef8747a9672ebc51e54c1dad885d6981740cd.tar.bz2
nnfw-7a6ef8747a9672ebc51e54c1dad885d6981740cd.zip
[loco] Adding shape inference for loco::BiasDecode (#7456)
This adds shape inference for loco::BiasDecode Signed-off-by: Hyun Sik Yoon <hyunsik.yoon@samsung.com>
-rw-r--r--compiler/loco/src/Service/CanonicalShapeInferenceRule.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/compiler/loco/src/Service/CanonicalShapeInferenceRule.cpp b/compiler/loco/src/Service/CanonicalShapeInferenceRule.cpp
index 9abe8ecc3..ef087d5f4 100644
--- a/compiler/loco/src/Service/CanonicalShapeInferenceRule.cpp
+++ b/compiler/loco/src/Service/CanonicalShapeInferenceRule.cpp
@@ -212,6 +212,21 @@ public:
return loco::NodeShape{output_feature_shape};
}
+ // CASE: BiasDecode
+ loco::NodeShape visit(const loco::BiasDecode *node) final
+ {
+ // The input of BiasDecode SHOULD BE a bias!
+ assert(node_shape(node->input()).domain() == loco::Domain::Bias);
+ auto input_bias_shape = node_shape(node->input()).as<loco::BiasShape>();
+
+ loco::TensorShape output_tensor_shape;
+
+ output_tensor_shape.rank(1);
+ output_tensor_shape.dim(0) = input_bias_shape.length();
+
+ return loco::NodeShape{output_tensor_shape};
+ }
+
// CASE: BiasEncode
loco::NodeShape visit(const loco::BiasEncode *node) final
{