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

Method Forward_cpu

src/caffe/layers/tanh_layer.cpp:11–19  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9
10template <typename Dtype>
11void TanHLayer<Dtype>::Forward_cpu(const vector<Blob<Dtype>*>& bottom,
12 const vector<Blob<Dtype>*>& top) {
13 const Dtype* bottom_data = bottom[0]->cpu_data();
14 Dtype* top_data = top[0]->mutable_cpu_data();
15 const int count = bottom[0]->count();
16 for (int i = 0; i < count; ++i) {
17 top_data[i] = tanh(bottom_data[i]);
18 }
19}
20
21template <typename Dtype>
22void TanHLayer<Dtype>::Backward_cpu(const vector<Blob<Dtype>*>& top,

Callers

nothing calls this directly

Calls 4

tanhFunction · 0.85
countMethod · 0.80
cpu_dataMethod · 0.45
mutable_cpu_dataMethod · 0.45

Tested by

no test coverage detected