Normally distributed MPSMatrixRandom number generation generates NaN

When generating large arrays of random numbers, NaNs show up. They also show up at the same indices when using the same seed, leading me to believe that this is a bug with MPSMatrixRandom's normally distributed Float32 random number distribution.

Happens with both Philox and MTGP32.

Is this intentional and how do I work around this?

See the original post for a MWE in Swift and Julia: https://github.com/JuliaGPU/Metal.jl/issues/474

Normally distributed MPSMatrixRandom number generation generates NaN
 
 
Q