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

Method LayerSetUp

src/caffe/layers/input_layer.cpp:8–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6
7template <typename Dtype>
8void InputLayer<Dtype>::LayerSetUp(const vector<Blob<Dtype>*>& bottom,
9 const vector<Blob<Dtype>*>& top) {
10 const int num_top = top.size();
11 const InputParameter& param = this->layer_param_.input_param();
12 const int num_shape = param.shape_size();
13 CHECK(num_shape == 0 || num_shape == 1 || num_shape == num_top)
14 << "Must specify 'shape' once, once per top blob, or not at all: "
15 << num_top << " tops vs. " << num_shape << " shapes.";
16 if (num_shape > 0) {
17 for (int i = 0; i < num_top; ++i) {
18 const int shape_index = (param.shape_size() == 1) ? 0 : i;
19 top[i]->Reshape(param.shape(shape_index));
20 }
21 }
22}
23
24INSTANTIATE_CLASS(InputLayer);
25REGISTER_LAYER_CLASS(Input);

Callers

nothing calls this directly

Calls 3

shapeMethod · 0.80
sizeMethod · 0.45
ReshapeMethod · 0.45

Tested by

no test coverage detected