You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/04/04 00:46:52 UTC

[GitHub] haojin2 commented on issue #7426: mx random seed doesn't work for random_uniform/random_normal on gpu

haojin2 commented on issue #7426: mx random seed doesn't work for random_uniform/random_normal on gpu
URL: https://github.com/apache/incubator-mxnet/issues/7426#issuecomment-378443952
 
 
   Seems like this issue has already been solved, I cannot reproduce it on the latest master(b1b0521366344b516a618ce73f7bc9a1c0708092):
   >>> import mxnet as mx
   >>> import numpy as np
   >>> shape = (2, 2)
   >>> out1 = mx.nd.zeros(shape=shape, ctx=mx.gpu(0))
   >>> out2 = mx.nd.zeros(shape=shape, ctx=mx.gpu(0))
   >>> mx.random.seed(0)
   >>> np.random.seed(0)
   >>> mx.nd.random_uniform(out=out1)
   [[ 0.66865093  0.17409194]
    [ 0.38500249  0.24678314]]
   <NDArray 2x2 @gpu(0)>
   >>> mx.random.seed(0)
   >>> np.random.seed(0)
   >>> mx.nd.random_uniform(out=out2)
   [[ 0.66865093  0.17409194]
    [ 0.38500249  0.24678314]]
   <NDArray 2x2 @gpu(0)>

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services