| 137 | |
| 138 | template<typename Dtype> |
| 139 | void HDF5DataLayer<Dtype>::Next() { |
| 140 | if (++current_row_ == hdf_blobs_[0]->shape(0)) { |
| 141 | if (num_files_ > 1) { |
| 142 | ++current_file_; |
| 143 | if (current_file_ == num_files_) { |
| 144 | current_file_ = 0; |
| 145 | if (this->layer_param_.hdf5_data_param().shuffle()) { |
| 146 | std::random_shuffle(file_permutation_.begin(), |
| 147 | file_permutation_.end()); |
| 148 | } |
| 149 | DLOG(INFO) << "Looping around to first file."; |
| 150 | } |
| 151 | LoadHDF5FileData( |
| 152 | hdf_filenames_[file_permutation_[current_file_]].c_str()); |
| 153 | } |
| 154 | current_row_ = 0; |
| 155 | if (this->layer_param_.hdf5_data_param().shuffle()) |
| 156 | std::random_shuffle(data_permutation_.begin(), data_permutation_.end()); |
| 157 | } |
| 158 | offset_++; |
| 159 | } |
| 160 | |
| 161 | template <typename Dtype> |
| 162 | void HDF5DataLayer<Dtype>::Forward_cpu(const vector<Blob<Dtype>*>& bottom, |