Skip to content

Commit

Permalink
check that LRN's local_size is odd as the current implementation requ…
Browse files Browse the repository at this point in the history
…ires
  • Loading branch information
longjon authored and shelhamer committed Sep 18, 2014
1 parent a0de7e6 commit 167af0d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/caffe/layers/lrn_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ template <typename Dtype>
void LRNLayer<Dtype>::LayerSetUp(const vector<Blob<Dtype>*>& bottom,
vector<Blob<Dtype>*>* top) {
size_ = this->layer_param_.lrn_param().local_size();
CHECK_EQ(size_ % 2, 1) << "LRN only supports odd values for local_size";
pre_pad_ = (size_ - 1) / 2;
alpha_ = this->layer_param_.lrn_param().alpha();
beta_ = this->layer_param_.lrn_param().beta();
Expand Down

0 comments on commit 167af0d

Please sign in to comment.