Skip to content

Commit c877b70

Browse files
committed
fix strided_slice layer: error of param end
1 parent 31c3c62 commit c877b70

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/caffe/layers/strided_slice_layer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ void StridedSliceLayer<Dtype>::LayerSetUp(const vector<Blob<Dtype> *> &bottom,
124124
if (strided_end_[i] >= 0) {
125125
strided_end_[i] = std::min(strided_end_[i], b_shape[i]);
126126
} else {
127-
strided_end_[i] = std::max(strided_end_[i] + b_shape[i], 0);
127+
strided_end_[i] = std::max(strided_end_[i] + b_shape[i], -1);
128128
}
129129
}
130130
// begin_mask and end_mask
@@ -188,7 +188,7 @@ void StridedSliceLayer<Dtype>::LayerSetUp(const vector<Blob<Dtype> *> &bottom,
188188
if (strided_end_[i] >= 0) {
189189
strided_end_[i] = std::min(strided_end_[i], b_shape[axes_[i]]);
190190
} else {
191-
strided_end_[i] = std::max(strided_end_[i] + b_shape[axes_[i]], 0);
191+
strided_end_[i] = std::max(strided_end_[i] + b_shape[axes_[i]], -1);
192192
}
193193
// caculate top shape
194194
if (strides_[i] > 0) {

0 commit comments

Comments
 (0)