| 46 | |
| 47 | template <typename Dtype> |
| 48 | void 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 |
| 62 | STUB_GPU(ExpLayer); |
nothing calls this directly
no test coverage detected