Skip to content

Commit bcd280d

Browse files
author
xuwei06
committed
Check the input size for convolution.
Make sure the input size is correct. Change-Id: I2559075e32a098c5ed51942ff8351d964a6d6c75
1 parent 5ac16e5 commit bcd280d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

paddle/gserver/layers/ConvProjection.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,12 @@ void ConvProjection::reshapeTensorDesc(int batchSize) {
130130
void ConvProjection::reshape(int batchSize) {
131131
size_t width = calOutputSize();
132132
CHECK_EQ(width, out_->value->getWidth());
133+
CHECK_EQ(channels_ * imageH_ * imageW_, in_->value->getWidth())
134+
<< "Wrong input size for convolution"
135+
<< " channels=" << channels_
136+
<< " imageH=" << imageH_
137+
<< " imageW=" << imageW_
138+
<< " inputSize=" << in_->value->getWidth();
133139

134140
isSelectAlgo_ = (batchSize == batchNum_);
135141
batchNum_ = batchSize;

0 commit comments

Comments
 (0)