* You should not implement your own constructor. Any set up code should go * to SetUp(), where the dimensions of the bottom blobs are provided to the * layer. */
| 38 | * layer. |
| 39 | */ |
| 40 | explicit Layer(const LayerParameter& param) |
| 41 | : layer_param_(param) { |
| 42 | // Set phase and copy blobs (if there are any). |
| 43 | phase_ = param.phase(); |
| 44 | if (layer_param_.blobs_size() > 0) { |
| 45 | blobs_.resize(layer_param_.blobs_size()); |
| 46 | for (int i = 0; i < layer_param_.blobs_size(); ++i) { |
| 47 | blobs_[i].reset(new Blob<Dtype>()); |
| 48 | blobs_[i]->FromProto(layer_param_.blobs(i)); |
| 49 | } |
| 50 | } |
| 51 | } |
| 52 | virtual ~Layer() {} |
| 53 | |
| 54 | /** |