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

Method Reshape

src/caffe/layers/mvn_layer.cpp:9–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7
8template <typename Dtype>
9void MVNLayer<Dtype>::Reshape(const vector<Blob<Dtype>*>& bottom,
10 const vector<Blob<Dtype>*>& top) {
11 top[0]->Reshape(bottom[0]->num(), bottom[0]->channels(),
12 bottom[0]->height(), bottom[0]->width());
13 mean_.Reshape(bottom[0]->num(), bottom[0]->channels(),
14 1, 1);
15 variance_.Reshape(bottom[0]->num(), bottom[0]->channels(),
16 1, 1);
17 temp_.Reshape(bottom[0]->num(), bottom[0]->channels(),
18 bottom[0]->height(), bottom[0]->width());
19 if ( this->layer_param_.mvn_param().across_channels() ) {
20 sum_multiplier_.Reshape(1, bottom[0]->channels(), bottom[0]->height(),
21 bottom[0]->width());
22 } else {
23 sum_multiplier_.Reshape(1, 1, bottom[0]->height(), bottom[0]->width());
24 }
25 Dtype* multiplier_data = sum_multiplier_.mutable_cpu_data();
26 caffe_set(sum_multiplier_.count(), Dtype(1), multiplier_data);
27 eps_ = this->layer_param_.mvn_param().eps();
28}
29
30template <typename Dtype>
31void MVNLayer<Dtype>::Forward_cpu(const vector<Blob<Dtype>*>& bottom,

Callers

nothing calls this directly

Calls 7

caffe_setFunction · 0.85
numMethod · 0.80
countMethod · 0.80
channelsMethod · 0.45
heightMethod · 0.45
widthMethod · 0.45
mutable_cpu_dataMethod · 0.45

Tested by

no test coverage detected