// 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<Dtype>());
+ blobs_[i]->FromProto(layer_param_.blobs(i));
+ }
+ }
+ }
virtual ~Layer() {}
// SetUp: your function should implement this.
virtual void SetUp(const vector<Blob<Dtype>*>& bottom,