From c78ec08d3c5a53b2ba9624a6639dddcfaebf2a3d Mon Sep 17 00:00:00 2001 From: Evan Shelhamer Date: Mon, 3 Feb 2014 11:15:10 -0800 Subject: [PATCH] fix flatten layer backwards to dummy return --- src/caffe/layers/flatten_layer.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/caffe/layers/flatten_layer.cpp b/src/caffe/layers/flatten_layer.cpp index f246744..a202f72 100644 --- a/src/caffe/layers/flatten_layer.cpp +++ b/src/caffe/layers/flatten_layer.cpp @@ -43,6 +43,7 @@ Dtype FlattenLayer::Backward_cpu(const vector*>& 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::Backward_gpu(const vector*>& 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); -- 2.7.4