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

Method Backward_cpu

src/caffe/layers/exp_layer.cpp:48–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46
47template <typename Dtype>
48void ExpLayer<Dtype>::Backward_cpu(const vector<Blob<Dtype>*>& top,
49 const vector<bool>& propagate_down, const vector<Blob<Dtype>*>& bottom) {
50 if (!propagate_down[0]) { return; }
51 const int count = bottom[0]->count();
52 const Dtype* top_data = top[0]->cpu_data();
53 const Dtype* top_diff = top[0]->cpu_diff();
54 Dtype* bottom_diff = bottom[0]->mutable_cpu_diff();
55 caffe_mul(count, top_data, top_diff, bottom_diff);
56 if (inner_scale_ != Dtype(1)) {
57 caffe_scal(count, inner_scale_, bottom_diff);
58 }
59}
60
61#ifdef CPU_ONLY
62STUB_GPU(ExpLayer);

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