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

Method Forward_cpu

src/caffe/layers/inner_product_layer.cpp:84–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82
83template <typename Dtype>
84void InnerProductLayer<Dtype>::Forward_cpu(const vector<Blob<Dtype>*>& bottom,
85 const vector<Blob<Dtype>*>& top) {
86 const Dtype* bottom_data = bottom[0]->cpu_data();
87 Dtype* top_data = top[0]->mutable_cpu_data();
88 const Dtype* weight = this->blobs_[0]->cpu_data();
89 caffe_cpu_gemm<Dtype>(CblasNoTrans, transpose_ ? CblasNoTrans : CblasTrans,
90 M_, N_, K_, (Dtype)1.,
91 bottom_data, weight, (Dtype)0., top_data);
92 if (bias_term_) {
93 caffe_cpu_gemm<Dtype>(CblasNoTrans, CblasNoTrans, M_, N_, 1, (Dtype)1.,
94 bias_multiplier_.cpu_data(),
95 this->blobs_[1]->cpu_data(), (Dtype)1., top_data);
96 }
97}
98
99template <typename Dtype>
100void InnerProductLayer<Dtype>::Backward_cpu(const vector<Blob<Dtype>*>& top,

Callers

nothing calls this directly

Calls 2

cpu_dataMethod · 0.45
mutable_cpu_dataMethod · 0.45

Tested by

no test coverage detected