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

Method Forward_cpu

src/caffe/layers/exp_layer.cpp:31–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29
30template <typename Dtype>
31void 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
47template <typename Dtype>
48void ExpLayer<Dtype>::Backward_cpu(const vector<Blob<Dtype>*>& top,

Callers

nothing calls this directly

Calls 3

countMethod · 0.80
cpu_dataMethod · 0.45
mutable_cpu_dataMethod · 0.45

Tested by

no test coverage detected