| 36 | |
| 37 | template <typename Dtype> |
| 38 | void TileLayer<Dtype>::Backward_cpu(const vector<Blob<Dtype>*>& top, |
| 39 | const vector<bool>& propagate_down, const vector<Blob<Dtype>*>& bottom) { |
| 40 | if (!propagate_down[0]) { return; } |
| 41 | const Dtype* top_diff = top[0]->cpu_diff(); |
| 42 | Dtype* bottom_diff = bottom[0]->mutable_cpu_diff(); |
| 43 | for (int i = 0; i < outer_dim_; ++i) { |
| 44 | caffe_copy(inner_dim_, top_diff, bottom_diff); |
| 45 | top_diff += inner_dim_; |
| 46 | for (int t = 1; t < tiles_; ++t) { |
| 47 | caffe_axpy(inner_dim_, Dtype(1), top_diff, bottom_diff); |
| 48 | top_diff += inner_dim_; |
| 49 | } |
| 50 | bottom_diff += inner_dim_; |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | #ifdef CPU_ONLY |
| 55 | STUB_GPU(TileLayer); |
nothing calls this directly
no test coverage detected