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

Method Forward_cpu

src/caffe/layers/hdf5_output_layer.cpp:41–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39
40template <typename Dtype>
41void HDF5OutputLayer<Dtype>::Forward_cpu(const vector<Blob<Dtype>*>& bottom,
42 const vector<Blob<Dtype>*>& top) {
43 CHECK_GE(bottom.size(), 2);
44 CHECK_EQ(bottom[0]->num(), bottom[1]->num());
45 data_blob_.Reshape(bottom[0]->num(), bottom[0]->channels(),
46 bottom[0]->height(), bottom[0]->width());
47 label_blob_.Reshape(bottom[1]->num(), bottom[1]->channels(),
48 bottom[1]->height(), bottom[1]->width());
49 const int data_datum_dim = bottom[0]->count() / bottom[0]->num();
50 const int label_datum_dim = bottom[1]->count() / bottom[1]->num();
51
52 for (int i = 0; i < bottom[0]->num(); ++i) {
53 caffe_copy(data_datum_dim, &bottom[0]->cpu_data()[i * data_datum_dim],
54 &data_blob_.mutable_cpu_data()[i * data_datum_dim]);
55 caffe_copy(label_datum_dim, &bottom[1]->cpu_data()[i * label_datum_dim],
56 &label_blob_.mutable_cpu_data()[i * label_datum_dim]);
57 }
58 SaveBlobs();
59}
60
61template <typename Dtype>
62void HDF5OutputLayer<Dtype>::Backward_cpu(const vector<Blob<Dtype>*>& top,

Callers

nothing calls this directly

Calls 10

caffe_copyFunction · 0.85
numMethod · 0.80
countMethod · 0.80
sizeMethod · 0.45
ReshapeMethod · 0.45
channelsMethod · 0.45
heightMethod · 0.45
widthMethod · 0.45
cpu_dataMethod · 0.45
mutable_cpu_dataMethod · 0.45

Tested by

no test coverage detected