| 29 | |
| 30 | template <typename Dtype> |
| 31 | void ExpLayer<Dtype>::Forward_cpu(const vector<Blob<Dtype>*>& bottom, |
| 32 | const vector<Blob<Dtype>*>& top) { |
| 33 | const int count = bottom[0]->count(); |
| 34 | const Dtype* bottom_data = bottom[0]->cpu_data(); |
| 35 | Dtype* top_data = top[0]->mutable_cpu_data(); |
| 36 | if (inner_scale_ == Dtype(1)) { |
| 37 | caffe_exp(count, bottom_data, top_data); |
| 38 | } else { |
| 39 | caffe_cpu_scale(count, inner_scale_, bottom_data, top_data); |
| 40 | caffe_exp(count, top_data, top_data); |
| 41 | } |
| 42 | if (outer_scale_ != Dtype(1)) { |
| 43 | caffe_scal(count, outer_scale_, top_data); |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | template <typename Dtype> |
| 48 | void ExpLayer<Dtype>::Backward_cpu(const vector<Blob<Dtype>*>& top, |
nothing calls this directly
no test coverage detected