| 39 | |
| 40 | template <typename Dtype> |
| 41 | void 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 | |
| 61 | template <typename Dtype> |
| 62 | void HDF5OutputLayer<Dtype>::Backward_cpu(const vector<Blob<Dtype>*>& top, |
nothing calls this directly
no test coverage detected