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

Method Backward_cpu

src/caffe/layers/tile_layer.cpp:38–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36
37template <typename Dtype>
38void 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
55STUB_GPU(TileLayer);

Callers

nothing calls this directly

Calls 3

caffe_copyFunction · 0.85
cpu_diffMethod · 0.80
mutable_cpu_diffMethod · 0.80

Tested by

no test coverage detected