Skip to content

Conversation

@luotao1
Copy link
Contributor

@luotao1 luotao1 commented Sep 18, 2017

fix #4136
refine related code to reduce unused computing.

int wstart = pw * strideW - padW;
int hend = min(hstart + sizeY, height + padH);
int wend = min(wstart + sizeX, width + padW);
int poolsize = (hend - hstart) * (wend - wstart);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是不是hstart,wstart还要取max

 hstart = max(hstart, 0); wstart = max(wstart, 0); 
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是的,谢谢!

CHECK(depth * height * width * channels == getWidth());
CHECK(width_ == depth * width * height * channels);
CHECK(imgSizeD * imgSizeH * imgSizeW * channels == getWidth());
CHECK(width_ == imgSizeD * imgSizeH * imgSizeW * channels);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CHECK(width_ == imgSizeD * imgSizeH * imgSizeW * channels);这行和上一行一个作用,删除一行吧(当初写这段代码的时候忘了删...)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已经删除,并把对应2d实现中多余的CHECK也删了。

Copy link
Contributor

@chengduoZH chengduoZH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM+

@luotao1 luotao1 merged commit b5a448f into PaddlePaddle:develop Sep 18, 2017
@luotao1 luotao1 deleted the avg_pool branch September 18, 2017 15:22
@luotao1 luotao1 mentioned this pull request Sep 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants