From: Yangqing Jia Date: Wed, 9 Oct 2013 23:49:50 +0000 (-0700) Subject: layer initialization X-Git-Tag: submit/tizen/20180823.020014~952 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1a2046a3448d6e6fada19561a3f1722f450ae945;p=platform%2Fupstream%2Fcaffeonacl.git layer initialization --- diff --git a/src/caffe/layer.hpp b/src/caffe/layer.hpp index 2b73daf..cbfde0c 100644 --- a/src/caffe/layer.hpp +++ b/src/caffe/layer.hpp @@ -19,7 +19,16 @@ class Layer { // to SetUp(), where the dimensions of the bottom blobs are provided to the // layer. explicit Layer(const LayerParameter& param) - : layer_param_(param) {} + : layer_param_(param) { + // The only thing we do is to copy blobs if there are any. + if (layer_param_.blobs_size() > 0) { + blobs_.resize(layer_param_.blobs_size()); + for (int i = 0; i < layer_param_.blobs_size(); ++i) { + blobs_[i].reset(new Blob()); + blobs_[i]->FromProto(layer_param_.blobs(i)); + } + } + } virtual ~Layer() {} // SetUp: your function should implement this. virtual void SetUp(const vector*>& bottom,