From 6e70ccc822504de54485a2eb1e318b32d2a7aaaa Mon Sep 17 00:00:00 2001 From: zhaojiaying01 Date: Fri, 31 Aug 2018 20:02:54 +0800 Subject: [PATCH] update the structure of the code of im2col.cpp --- .../kernel/central-arm-func/conv_transpose_arm_func.h | 4 ---- src/operators/math/im2col.cpp | 1 + 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/operators/kernel/central-arm-func/conv_transpose_arm_func.h b/src/operators/kernel/central-arm-func/conv_transpose_arm_func.h index 51dac36aee..343e5f1476 100644 --- a/src/operators/kernel/central-arm-func/conv_transpose_arm_func.h +++ b/src/operators/kernel/central-arm-func/conv_transpose_arm_func.h @@ -96,10 +96,6 @@ void ConvTransposeCompute(const ConvTransposeParam ¶m) { math::matmul(filter_slice, true, in_slice, false, static_cast

(1.0), &col_matrix, static_cast

(0.0)); - //初始化out_slice的值为0 - float *tmp = out_slice.data(); - int numel = out_slice.numel(); - memset(static_cast(tmp), 0, sizeof(float) * numel); if (data_dim == 2U) { col2im(col, dilations, strides, std::vector{paddings[0], paddings[1], paddings[0], diff --git a/src/operators/math/im2col.cpp b/src/operators/math/im2col.cpp index cb4d02f45c..4065f7d9c4 100644 --- a/src/operators/math/im2col.cpp +++ b/src/operators/math/im2col.cpp @@ -481,6 +481,7 @@ class Col2ImFunctor { T *im_data = im->data(); const T *col_data = col.data(); + memset(static_cast(im_data), 0, sizeof(T) * im->numel()); for (int c = 0; c < channels_col; ++c) { int w_offset = c % filter_width; -- GitLab