[moco-tf] Use loco::NodeShape in copy_shapedata (#6984)
author박세희/On-Device Lab(SR)/Principal Engineer/삼성전자 <saehie.park@samsung.com>
Wed, 28 Aug 2019 06:53:36 +0000 (15:53 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Wed, 28 Aug 2019 06:53:36 +0000 (15:53 +0900)
This will change to use loco::NodeShape if exist as shape information in copy_shapedata()

Signed-off-by: SaeHie Park <saehie.park@samsung.com>
compiler/moco-tf/src/Transforms/FixShapeTransform.cpp

index 8a74e92..33f3832 100644 (file)
@@ -108,6 +108,15 @@ bool copy_shapedata(const loco::Node *src, loco::Node *dst)
   if (dst_shapedata != nullptr)
     return false;
 
+  // if src has loco::NodeShape, use it
+  if (loco::shape_known(src))
+  {
+    auto shape_data = make_shape_inference_data(loco::shape_get(src));
+    dst->annot(std::move(shape_data));
+
+    return true;
+  }
+
   // if src doesn't have ShapeInferenceData, skip
   auto src_shapedata = src->annot<ShapeInferenceData>();
   if (src_shapedata == nullptr)