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

Method Forward_cpu

src/caffe/layers/bias_layer.cpp:72–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70
71template <typename Dtype>
72void BiasLayer<Dtype>::Forward_cpu(const vector<Blob<Dtype>*>& bottom,
73 const vector<Blob<Dtype>*>& top) {
74 const Dtype* bias_data =
75 ((bottom.size() > 1) ? bottom[1] : this->blobs_[0].get())->cpu_data();
76 Dtype* top_data = top[0]->mutable_cpu_data();
77 if (bottom[0] != top[0]) {
78 const Dtype* bottom_data = bottom[0]->cpu_data();
79 caffe_copy(bottom[0]->count(), bottom_data, top_data);
80 }
81 for (int n = 0; n < outer_dim_; ++n) {
82 caffe_cpu_gemm(CblasNoTrans, CblasNoTrans, bias_dim_,
83 inner_dim_, 1, Dtype(1), bias_data,
84 bias_multiplier_.cpu_data(), Dtype(1), top_data);
85 top_data += dim_;
86 }
87}
88
89template <typename Dtype>
90void BiasLayer<Dtype>::Backward_cpu(const vector<Blob<Dtype>*>& top,

Callers

nothing calls this directly

Calls 6

caffe_copyFunction · 0.85
countMethod · 0.80
cpu_dataMethod · 0.45
sizeMethod · 0.45
getMethod · 0.45
mutable_cpu_dataMethod · 0.45

Tested by

no test coverage detected