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

Method Forward_cpu

src/caffe/layers/threshold_layer.cpp:15–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13
14template <typename Dtype>
15void ThresholdLayer<Dtype>::Forward_cpu(const vector<Blob<Dtype>*>& bottom,
16 const vector<Blob<Dtype>*>& top) {
17 const Dtype* bottom_data = bottom[0]->cpu_data();
18 Dtype* top_data = top[0]->mutable_cpu_data();
19 const int count = bottom[0]->count();
20 for (int i = 0; i < count; ++i) {
21 top_data[i] = (bottom_data[i] > threshold_) ? Dtype(1) : Dtype(0);
22 }
23}
24
25#ifdef CPU_ONLY
26STUB_GPU_FORWARD(ThresholdLayer, Forward);

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