From 7bca982a5178b6cc44ae362bba3da4d2f27e176e Mon Sep 17 00:00:00 2001 From: HappyAngel Date: Mon, 25 Nov 2019 18:20:36 +0800 Subject: [PATCH] [lite] fix compute shape error in operator/conv_op.cc (#2490) fix ccompute shape error in ooperators/conv_op.h, test=develop --- lite/operators/conv_op.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lite/operators/conv_op.cc b/lite/operators/conv_op.cc index 56bb95da01..d9c0ecb4fd 100644 --- a/lite/operators/conv_op.cc +++ b/lite/operators/conv_op.cc @@ -62,9 +62,9 @@ inline void UpdatePaddingAndDilation(std::vector* paddings, if (padding_algorithm == "SAME") { for (size_t i = 0; i < strides.size(); ++i) { int out_size = (data_dims[i + 2] + strides[i] - 1) / strides[i]; - int pad_sum = - std::max((out_size - 1) * strides[i] + ksize[i] - data_dims[i + 2], - (int64_t)0); + int pad_sum = std::max( + (out_size - 1) * strides[i] + ksize[i + 2] - data_dims[i + 2], + (int64_t)0); int pad_0 = pad_sum / 2; int pad_1 = pad_sum - pad_0; // pad -- GitLab