python-dask/0005-Force-initializing-the-random-seed-with-the-same-byt.patch
2024-02-29 20:31:56 -05:00

28 lines
929 B
Diff

From 741c375b14edcc5b32d1641b11a39d8ee5679496 Mon Sep 17 00:00:00 2001
From: Diane Trout <diane@ghic.org>
Date: Thu, 29 Feb 2024 19:39:26 -0500
Subject: [PATCH 5/8] Force initializing the random seed with the same byte
order interpretation as on x86
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
dask/utils.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dask/utils.py b/dask/utils.py
index 0e974fe4..4dcfca42 100644
--- a/dask/utils.py
+++ b/dask/utils.py
@@ -557,7 +557,7 @@ def random_state_data(n: int, random_state=None) -> list:
random_state = np.random.RandomState(random_state)
random_data = random_state.bytes(624 * n * 4) # `n * 624` 32-bit integers
- l = list(np.frombuffer(random_data, dtype=np.uint32).reshape((n, -1)))
+ l = list(np.frombuffer(random_data, dtype="<u4").reshape((n, -1)))
assert len(l) == n
return l
--
2.43.0