diff options
author | 박세희/On-Device Lab(SR)/Principal Engineer/삼성전자 <saehie.park@samsung.com> | 2019-09-17 18:26:48 +0900 |
---|---|---|
committer | GitHub Enterprise <noreply-CODE@samsung.com> | 2019-09-17 18:26:48 +0900 |
commit | ae69900a8899873979a84efe423ccea3323a8b99 (patch) | |
tree | ac382d3ceaeaf025a262cc8fc20d5d0feb0128b3 | |
parent | bdf28f49e816ac22193073be5da1acae0cc655e6 (diff) | |
download | nnfw-ae69900a8899873979a84efe423ccea3323a8b99.tar.gz nnfw-ae69900a8899873979a84efe423ccea3323a8b99.tar.bz2 nnfw-ae69900a8899873979a84efe423ccea3323a8b99.zip |
[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.cpp | 16 |
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 934f5793a..93570dbbc 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; |