summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author박세희/On-Device Lab(SR)/Principal Engineer/삼성전자 <saehie.park@samsung.com>2019-09-17 09:26:48 (GMT)
committerGitHub Enterprise <noreply-CODE@samsung.com>2019-09-17 09:26:48 (GMT)
commitae69900a8899873979a84efe423ccea3323a8b99 (patch)
treeac382d3ceaeaf025a262cc8fc20d5d0feb0128b3
parentbdf28f49e816ac22193073be5da1acae0cc655e6 (diff)
downloadnnfw-ae69900a8899873979a84efe423ccea3323a8b99.zip
nnfw-ae69900a8899873979a84efe423ccea3323a8b99.tar.gz
nnfw-ae69900a8899873979a84efe423ccea3323a8b99.tar.bz2
[moco-tf] get_node_shape helper in copy_shapedata (#7528)
This will introduce get_node_shape helper in copy_shapedata of FixShape Signed-off-by: Jonghyun Park <jh1302.park@samsung.com> Signed-off-by: SaeHie Park <saehie.park@samsung.com>
-rw-r--r--compiler/moco-tf/src/Transforms/FixShapeTransform.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/compiler/moco-tf/src/Transforms/FixShapeTransform.cpp b/compiler/moco-tf/src/Transforms/FixShapeTransform.cpp
index 934f579..93570db 100644
--- a/compiler/moco-tf/src/Transforms/FixShapeTransform.cpp
+++ b/compiler/moco-tf/src/Transforms/FixShapeTransform.cpp
@@ -294,6 +294,22 @@ bool copy_shapedata(const loco::Node *lhs, const loco::Node *rhs, loco::Node *ds
if (shape_inference_done(dst))
return false;
+ auto get_node_shape = [](const loco::Node *node, loco::NodeShape &out) {
+ if (loco::shape_known(node))
+ {
+ out = loco::shape_get(node);
+ }
+ else
+ {
+ if (!shape_inference_done(node))
+ return false;
+
+ out = as_node_shape(node->annot<ShapeInferenceData>());
+ }
+
+ return true;
+ };
+
loco::NodeShape lhs_shape;
loco::NodeShape rhs_shape;