| 309 | } |
| 310 | |
| 311 | void Examples::RandomShuffle() { |
| 312 | std::iota(sampled_index_.begin(), sampled_index_.end(), 0); |
| 313 | |
| 314 | std::random_device rd; |
| 315 | std::mt19937 rng(rd()); |
| 316 | std::shuffle(sampled_index_.begin(), sampled_index_.end(), rng); |
| 317 | } |
| 318 | |
| 319 | // TODO(sibyl-Aix6ihai): Refactor/shorten this function. |
| 320 | Status Examples::Initialize(OpKernelContext* const context, |