Skip to content

Commit 568e059

Browse files
committed
fix an possible issue of reshape for TileND
1 parent 96e7fbe commit 568e059

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/caffe/layers/tile_nd_layer.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ void TileNDLayer<Dtype>::Reshape(
2727
const vector<Blob<Dtype>*>& bottom, const vector<Blob<Dtype>*>& top) {
2828
vector<int> top_shape = bottom[0]->shape();
2929
for(int i=multiples_.size()-1;i>=0;i--)
30-
top_shape[i] = bottom[0]->shape()[i] * multiples_[i];
30+
if (multiples_[i] > 1)
31+
top_shape[i] = bottom[0]->shape()[i] * multiples_[i];
3132
top[0]->Reshape(top_shape);
3233
}
3334

0 commit comments

Comments
 (0)