Remove call to std::random_shuffle.
std::random_shuffle is removed in C++17, and is causing TF to be not buildable in such configurations. Helps with Issue #23561 PiperOrigin-RevId: 231984187
This commit is contained in:
parent
1501b31d25
commit
0dc200d8da
@ -310,7 +310,10 @@ Status Examples::SampleAdaptiveProbabilities(
|
|||||||
|
|
||||||
void Examples::RandomShuffle() {
|
void Examples::RandomShuffle() {
|
||||||
std::iota(sampled_index_.begin(), sampled_index_.end(), 0);
|
std::iota(sampled_index_.begin(), sampled_index_.end(), 0);
|
||||||
std::random_shuffle(sampled_index_.begin(), sampled_index_.end());
|
|
||||||
|
std::random_device rd;
|
||||||
|
std::mt19937 rng(rd());
|
||||||
|
std::shuffle(sampled_index_.begin(), sampled_index_.end(), rng);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(sibyl-Aix6ihai): Refactor/shorten this function.
|
// TODO(sibyl-Aix6ihai): Refactor/shorten this function.
|
||||||
|
Loading…
Reference in New Issue
Block a user