Skip to content

Commit

Permalink
Merge pull request PaddlePaddle#1751 from Xreki/check_image_size
Browse files Browse the repository at this point in the history
Add the check of image size in exconv.
  • Loading branch information
Xreki authored Apr 6, 2017
2 parents cae15ed + 1628fb7 commit f7be384
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions paddle/gserver/layers/ExpandConvBaseLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ void ExpandConvBaseLayer::expandOneFrame(MatrixPtr image,
int channel = isDeconv_ ? numFilters_ : channels_[inIdx];

resetExpandInput(subK_[inIdx] * groups_[inIdx], subN_[inIdx]);

CHECK_EQ(image->getWidth(),
static_cast<size_t>(imgSizeH_[inIdx] * imgSizeW_[inIdx] * channel));

real *imgData = image->getData() + startIdx * image->getWidth();
MatrixPtr imageTmp =
Matrix::create(imgData,
Expand Down

0 comments on commit f7be384

Please sign in to comment.