MCPcopy Create free account
hub / github.com/BVLC/caffe / LayerSetUp

Method LayerSetUp

src/caffe/layers/eltwise_layer.cpp:10–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8
9template <typename Dtype>
10void EltwiseLayer<Dtype>::LayerSetUp(const vector<Blob<Dtype>*>& bottom,
11 const vector<Blob<Dtype>*>& top) {
12 CHECK(this->layer_param().eltwise_param().coeff_size() == 0
13 || this->layer_param().eltwise_param().coeff_size() == bottom.size()) <<
14 "Eltwise Layer takes one coefficient per bottom blob.";
15 CHECK(!(this->layer_param().eltwise_param().operation()
16 == EltwiseParameter_EltwiseOp_PROD
17 && this->layer_param().eltwise_param().coeff_size())) <<
18 "Eltwise layer only takes coefficients for summation.";
19 op_ = this->layer_param_.eltwise_param().operation();
20 // Blob-wise coefficients for the elementwise operation.
21 coeffs_ = vector<Dtype>(bottom.size(), 1);
22 if (this->layer_param().eltwise_param().coeff_size()) {
23 for (int i = 0; i < bottom.size(); ++i) {
24 coeffs_[i] = this->layer_param().eltwise_param().coeff(i);
25 }
26 }
27 stable_prod_grad_ = this->layer_param_.eltwise_param().stable_prod_grad();
28}
29
30template <typename Dtype>
31void EltwiseLayer<Dtype>::Reshape(const vector<Blob<Dtype>*>& bottom,

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected