From: 박세희/On-Device Lab(SR)/Principal Engineer/삼성전자 Date: Wed, 7 Aug 2019 06:42:17 +0000 (+0900) Subject: [moco-tf] Fix pad for TF dialect nodes in FixShape (#6302) X-Git-Tag: submit/tizen/20190809.050447~76 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=aff7e446df4c127a58d8c0daa321f778229c3165;p=platform%2Fcore%2Fml%2Fnnfw.git [moco-tf] Fix pad for TF dialect nodes in FixShape (#6302) This will merge fix pad for TF dialect nodes in FixShapeInference using calc_annot_paddata() method Signed-off-by: SaeHie Park --- diff --git a/compiler/moco-tf/src/Transforms/FixShapeTransform.cpp b/compiler/moco-tf/src/Transforms/FixShapeTransform.cpp index 65ec1e5..b9261a2 100644 --- a/compiler/moco-tf/src/Transforms/FixShapeTransform.cpp +++ b/compiler/moco-tf/src/Transforms/FixShapeTransform.cpp @@ -1028,8 +1028,14 @@ bool fix_shape(moco::tf::TFDepthwiseConv2dNative *node) shape_data->tensor_shape(ofm_tensor_shape); node->annot(std::move(shape_data)); + FixPadContext ctx = {input_height, input_width, output_height, output_width, + stride_height, stride_width, effective_ker_height, effective_ker_width}; + + calc_annot_paddata(node, ctx); + INFO(l) << "Fix TFDepthwiseConv2dNative shape = ifm" << ifm_tensor_shape << " ker" << ker_tensor_shape << " --> ofm" << ofm_tensor_shape; + INFO(l) << " pad = " << *node->annot(); return true; } @@ -1150,7 +1156,14 @@ bool fix_shape(moco::tf::TFMaxPool *node) as_tensor_shape(*shape_data.get(), ofm_feature_shape, node->data_layout()); node->annot(std::move(shape_data)); + FixPadContext ctx = { + input_height, input_width, output_height, output_width, + stride_height, stride_width, effective_window_height, effective_window_width}; + + calc_annot_paddata(node, ctx); + INFO(l) << "Fix TFMaxPool shape = ifm" << value_feature_shape << " --> ofm" << ofm_feature_shape; + INFO(l) << " pad = " << *node->annot(); return true; }