fix flatten layer backwards to dummy return
authorEvan Shelhamer <shelhamer@imaginarynumber.net>
Mon, 3 Feb 2014 19:15:10 +0000 (11:15 -0800)
committerEvan Shelhamer <shelhamer@imaginarynumber.net>
Mon, 3 Feb 2014 19:15:10 +0000 (11:15 -0800)
src/caffe/layers/flatten_layer.cpp

index f246744..a202f72 100644 (file)
@@ -43,6 +43,7 @@ Dtype FlattenLayer<Dtype>::Backward_cpu(const vector<Blob<Dtype>*>& top,
   const Dtype* top_diff = top[0]->cpu_diff();
   Dtype* bottom_diff = (*bottom)[0]->mutable_cpu_diff();
   caffe_copy(count_, top_diff, bottom_diff);
+  return Dtype(0.);
 }
 
 
@@ -52,6 +53,7 @@ Dtype FlattenLayer<Dtype>::Backward_gpu(const vector<Blob<Dtype>*>& top,
   const Dtype* top_diff = top[0]->gpu_diff();
   Dtype* bottom_diff = (*bottom)[0]->mutable_gpu_diff();
   caffe_gpu_copy(count_, top_diff, bottom_diff);
+  return Dtype(0.);
 }
 
 INSTANTIATE_CLASS(FlattenLayer);