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

Method Backward_cpu

src/caffe/layers/absval_layer.cpp:25–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23
24template <typename Dtype>
25void AbsValLayer<Dtype>::Backward_cpu(const vector<Blob<Dtype>*>& top,
26 const vector<bool>& propagate_down, const vector<Blob<Dtype>*>& bottom) {
27 const int count = top[0]->count();
28 const Dtype* top_diff = top[0]->cpu_diff();
29 if (propagate_down[0]) {
30 const Dtype* bottom_data = bottom[0]->cpu_data();
31 Dtype* bottom_diff = bottom[0]->mutable_cpu_diff();
32 caffe_cpu_sign(count, bottom_data, bottom_diff);
33 caffe_mul(count, bottom_diff, top_diff, bottom_diff);
34 }
35}
36
37#ifdef CPU_ONLY
38STUB_GPU(AbsValLayer);

Callers

nothing calls this directly

Calls 4

countMethod · 0.80
cpu_diffMethod · 0.80
mutable_cpu_diffMethod · 0.80
cpu_dataMethod · 0.45

Tested by

no test coverage detected