Skip to content

Commit f7be384

Browse files
authored
Merge pull request #1751 from Xreki/check_image_size
Add the check of image size in exconv.
2 parents cae15ed + 1628fb7 commit f7be384

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

paddle/gserver/layers/ExpandConvBaseLayer.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ void ExpandConvBaseLayer::expandOneFrame(MatrixPtr image,
107107
int channel = isDeconv_ ? numFilters_ : channels_[inIdx];
108108

109109
resetExpandInput(subK_[inIdx] * groups_[inIdx], subN_[inIdx]);
110+
111+
CHECK_EQ(image->getWidth(),
112+
static_cast<size_t>(imgSizeH_[inIdx] * imgSizeW_[inIdx] * channel));
113+
110114
real *imgData = image->getData() + startIdx * image->getWidth();
111115
MatrixPtr imageTmp =
112116
Matrix::create(imgData,

0 commit comments

Comments
 (0)