| 536 | |
| 537 | template <typename Dtype> |
| 538 | void DataTransformer<Dtype>::InitRand() { |
| 539 | const bool needs_rand = param_.mirror() || |
| 540 | (phase_ == TRAIN && param_.crop_size()); |
| 541 | if (needs_rand) { |
| 542 | const unsigned int rng_seed = caffe_rng_rand(); |
| 543 | rng_.reset(new Caffe::RNG(rng_seed)); |
| 544 | } else { |
| 545 | rng_.reset(); |
| 546 | } |
| 547 | } |
| 548 | |
| 549 | template <typename Dtype> |
| 550 | int DataTransformer<Dtype>::Rand(int n) { |