Skip to content

Commit

Permalink
Merge pull request #3152 from jeffdonahue/silence-backward-fix
Browse files Browse the repository at this point in the history
SilenceLayer Backward bugfix (fixes #3151)
  • Loading branch information
jeffdonahue committed Oct 5, 2015
2 parents 92dc4e6 + 64f948a commit 8ef3d63
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/caffe/layers/silence_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ void SilenceLayer<Dtype>::Backward_cpu(const vector<Blob<Dtype>*>& top,
for (int i = 0; i < bottom.size(); ++i) {
if (propagate_down[i]) {
caffe_set(bottom[i]->count(), Dtype(0),
bottom[i]->mutable_cpu_data());
bottom[i]->mutable_cpu_diff());
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/caffe/layers/silence_layer.cu
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ void SilenceLayer<Dtype>::Backward_gpu(const vector<Blob<Dtype>*>& top,
for (int i = 0; i < bottom.size(); ++i) {
if (propagate_down[i]) {
caffe_gpu_set(bottom[i]->count(), Dtype(0),
bottom[i]->mutable_gpu_data());
bottom[i]->mutable_gpu_diff());
}
}
}
Expand Down

0 comments on commit 8ef3d63

Please sign in to comment.