| 23 | |
| 24 | template <typename Dtype> |
| 25 | void ConvolutionLayer<Dtype>::Forward_cpu(const vector<Blob<Dtype>*>& bottom, |
| 26 | const vector<Blob<Dtype>*>& top) { |
| 27 | const Dtype* weight = this->blobs_[0]->cpu_data(); |
| 28 | for (int i = 0; i < bottom.size(); ++i) { |
| 29 | const Dtype* bottom_data = bottom[i]->cpu_data(); |
| 30 | Dtype* top_data = top[i]->mutable_cpu_data(); |
| 31 | for (int n = 0; n < this->num_; ++n) { |
| 32 | this->forward_cpu_gemm(bottom_data + n * this->bottom_dim_, weight, |
| 33 | top_data + n * this->top_dim_); |
| 34 | if (this->bias_term_) { |
| 35 | const Dtype* bias = this->blobs_[1]->cpu_data(); |
| 36 | this->forward_cpu_bias(top_data + n * this->top_dim_, bias); |
| 37 | } |
| 38 | } |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | template <typename Dtype> |
| 43 | void ConvolutionLayer<Dtype>::Backward_cpu(const vector<Blob<Dtype>*>& top, |
nothing calls this directly
no test coverage detected