| 9 | |
| 10 | template <typename Dtype> |
| 11 | void 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 | |
| 21 | template <typename Dtype> |
| 22 | void TanHLayer<Dtype>::Backward_cpu(const vector<Blob<Dtype>*>& top, |
nothing calls this directly
no test coverage detected