提交 7bca982a 编写于 作者: H HappyAngel 提交者: yiicy

[lite] fix compute shape error in operator/conv_op.cc (#2490)

 fix ccompute shape error in ooperators/conv_op.h, test=develop
上级 71267a90
...@@ -62,9 +62,9 @@ inline void UpdatePaddingAndDilation(std::vector<int>* paddings, ...@@ -62,9 +62,9 @@ inline void UpdatePaddingAndDilation(std::vector<int>* paddings,
if (padding_algorithm == "SAME") { if (padding_algorithm == "SAME") {
for (size_t i = 0; i < strides.size(); ++i) { for (size_t i = 0; i < strides.size(); ++i) {
int out_size = (data_dims[i + 2] + strides[i] - 1) / strides[i]; int out_size = (data_dims[i + 2] + strides[i] - 1) / strides[i];
int pad_sum = int pad_sum = std::max(
std::max((out_size - 1) * strides[i] + ksize[i] - data_dims[i + 2], (out_size - 1) * strides[i] + ksize[i + 2] - data_dims[i + 2],
(int64_t)0); (int64_t)0);
int pad_0 = pad_sum / 2; int pad_0 = pad_sum / 2;
int pad_1 = pad_sum - pad_0; int pad_1 = pad_sum - pad_0;
// pad // pad
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册