Best way to replace np.random.shuffle in MLX #1466
Unanswered
sck-at-ucy
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have been trying to refactor my physics-based Transformer code so that it all calls to numpy are removed and everything is implemented in MLX. I am almost there, a pure MLX implementation. 😀
In several places in the code I have been using np.random.shuffle() to randomize the generation of datasets (boundary conditions) and also during the loading of batches. My MLX solution has been the following , but I am wondering if this is the most efficient option or if I am missing a built-in option. Any insights from @awni would be appreciated.
Numpy implementation
MLX Refactoring
Beta Was this translation helpful? Give feedback.
All reactions