From: 박세희/On-Device Lab(SR)/Principal Engineer/삼성전자 Date: Thu, 29 Aug 2019 00:38:47 +0000 (+0900) Subject: [moco-tf] Use make_shape_inference_data in fix_shape (#6998) X-Git-Tag: accepted/tizen/unified/20190903.052428~72 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e650b39d226acdaf297154500006053f9abea04c;p=platform%2Fcore%2Fml%2Fnnfw.git [moco-tf] Use make_shape_inference_data in fix_shape (#6998) This will use make_shape_inference_data() for patterns of make_unique() + copy_shape_values() with ShapeInferenceData Signed-off-by: SaeHie Park --- diff --git a/compiler/moco-tf/src/Transforms/FixShapeTransform.cpp b/compiler/moco-tf/src/Transforms/FixShapeTransform.cpp index 7467b01..8304c61 100644 --- a/compiler/moco-tf/src/Transforms/FixShapeTransform.cpp +++ b/compiler/moco-tf/src/Transforms/FixShapeTransform.cpp @@ -147,8 +147,7 @@ bool copy_shapedata(const loco::Node *src, loco::Node *dst) if (src_shapedata == nullptr) return false; - auto shape_data = stdex::make_unique(); - copy_shape_values(src_shapedata, shape_data.get()); + auto shape_data = make_shape_inference_data(src_shapedata); dst->annot(std::move(shape_data)); return true; @@ -731,10 +730,9 @@ bool fix_shape(loco::Pull *node) // shape inference is already done for Pull return false; } - auto shape_data = stdex::make_unique(); // Pull itself has shape information, copy them - copy_shape_values(node, shape_data.get()); + auto shape_data = make_shape_inference_data(node); node->annot(std::move(shape_data)); return true; @@ -1105,8 +1103,7 @@ bool fix_shape(moco::tf::TFConst *node) } // TFConst itself has shape information, copy them - auto shape_data = stdex::make_unique(); - copy_shape_values(node, shape_data.get()); + auto shape_data = make_shape_inference_data(node); node->annot(std::move(shape_data)); { @@ -1715,8 +1712,7 @@ bool fix_shape(locoex::COpCall *node) if (shapedata != nullptr) return false; - auto shape_data = stdex::make_unique(); - copy_shape_values(node, shape_data.get()); // copy node's TensorShape info to ShapeInferenceData + auto shape_data = make_shape_inference_data(node); node->annot(std::move(shape_data)); return true;