Set bottom_diff to 0 and remove Async memcopy
authorSergio <sguada@gmail.com>
Mon, 14 Apr 2014 03:11:49 +0000 (20:11 -0700)
committerJeff Donahue <jeff.donahue@gmail.com>
Sat, 24 May 2014 22:15:10 +0000 (15:15 -0700)
src/caffe/layers/pooling_layer.cu

index 95a754f..77126e6 100644 (file)
@@ -327,6 +327,7 @@ void PoolingLayer<Dtype>::Backward_gpu(const vector<Blob<Dtype>*>& top,
     // Since we have the mask we only need count top_diff
     count = top[0]->count(); 
     // NOLINT_NEXT_LINE(whitespace/operators)
+    caffe_gpu_memset(count,Dtype(0.),bottom_diff);
     MaxPoolBackward<Dtype><<<CAFFE_GET_BLOCKS(count), CAFFE_CUDA_NUM_THREADS>>>(
         count, top_diff, top[0]->num(), channels_,
         height_, width_, pooled_height_, pooled_width_,