提交 6e70ccc8 编写于 作者: Z zhaojiaying01

update the structure of the code of im2col.cpp

上级 eee0843e
......@@ -96,10 +96,6 @@ void ConvTransposeCompute(const ConvTransposeParam<CPU> &param) {
math::matmul(filter_slice, true, in_slice, false, static_cast<P>(1.0),
&col_matrix, static_cast<P>(0.0));
//初始化out_slice的值为0
float *tmp = out_slice.data<float>();
int numel = out_slice.numel();
memset(static_cast<void *>(tmp), 0, sizeof(float) * numel);
if (data_dim == 2U) {
col2im(col, dilations, strides,
std::vector<int>{paddings[0], paddings[1], paddings[0],
......
......@@ -481,6 +481,7 @@ class Col2ImFunctor<ColFormat::kCFO, CPU, T> {
T *im_data = im->data<T>();
const T *col_data = col.data<T>();
memset(static_cast<void *>(im_data), 0, sizeof(T) * im->numel());
for (int c = 0; c < channels_col; ++c) {
int w_offset = c % filter_width;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册