mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 13:44:15 +08:00
Use random64 in Fischer-Yates algorithm for large N (#143682)
Fixes bug in randperm https://nbsanity.com/static/a4774194938414dedcec7d6e99727d31/Shuffling_20in_20torch_20vs_20numpy-public.html Pull Request resolved: https://github.com/pytorch/pytorch/pull/143682 Approved by: https://github.com/eqy, https://github.com/albanD
This commit is contained in:
committed by
PyTorch MergeBot
parent
27b0d41f0a
commit
7013be0094
@ -246,7 +246,7 @@ class TestDatasetRandomSplit(TestCase):
|
||||
range(10), [3, 7], generator=torch.Generator().manual_seed(1)
|
||||
)
|
||||
],
|
||||
[[5, 6, 1], [2, 0, 8, 9, 3, 7, 4]],
|
||||
[[8, 4, 2], [0, 7, 5, 3, 6, 9, 1]],
|
||||
)
|
||||
self.assertEqual(
|
||||
random_split(
|
||||
|
Reference in New Issue
Block a user