File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
paddle/fluid/operators/math Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -54,12 +54,13 @@ class Im2ColFunctor<paddle::operators::math::ColFormat::kCFO,
54
54
if (stride[0 ] == 1 && stride[1 ] == 1 && dilation[0 ] == 1 &&
55
55
dilation[1 ] == 1 && padding[0 ] == 0 && padding[1 ] == 0 ) {
56
56
int col_matrix_width = output_width * output_height;
57
+ int im_size = im_height * im_width;
57
58
size_t copy_size = sizeof (T) * output_width;
58
59
for (int oh = 0 ; oh < output_height; ++oh) {
59
60
const T* im_data_start = im_data + oh * im_width;
60
61
T* dst_data = col_data + oh * output_width;
61
62
for (int ic = 0 ; ic < im_channels; ++ic) {
62
- const T* src_data = im_data_start + ic * im_height * im_width ;
63
+ const T* src_data = im_data_start + ic * im_size ;
63
64
for (int kh = 0 ; kh < filter_height; ++kh) {
64
65
for (int kw = 0 ; kw < filter_width; ++kw) {
65
66
std::memcpy (dst_data, src_data + kw, copy_size);
You can’t perform that action at this time.
0 commit comments