| 81 | |
| 82 | template <typename Dtype> |
| 83 | void MemoryDataLayer<Dtype>::Reset(Dtype* data, Dtype* labels, int n) { |
| 84 | CHECK(data); |
| 85 | CHECK(labels); |
| 86 | CHECK_EQ(n % batch_size_, 0) << "n must be a multiple of batch size"; |
| 87 | // Warn with transformation parameters since a memory array is meant to |
| 88 | // be generic and no transformations are done with Reset(). |
| 89 | if (this->layer_param_.has_transform_param()) { |
| 90 | LOG(WARNING) << this->type() << " does not transform array data on Reset()"; |
| 91 | } |
| 92 | data_ = data; |
| 93 | labels_ = labels; |
| 94 | n_ = n; |
| 95 | pos_ = 0; |
| 96 | } |
| 97 | |
| 98 | template <typename Dtype> |
| 99 | void MemoryDataLayer<Dtype>::set_batch_size(int new_size) { |