You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@mxnet.apache.org by GitBox <gi...@apache.org> on 2020/10/26 03:13:50 UTC

[GitHub] [incubator-mxnet] dibgerge opened a new issue #19423: Unexpected behavior of np.random.choice

dibgerge opened a new issue #19423:
URL: https://github.com/apache/incubator-mxnet/issues/19423


   ## Description
   
   When using `np.random.choice(num, size=num, replace=False)`, where `num` is the same for the input array, and size of output array, then I am always getting a sorted array, i.e. same as `np.arange(num)`. 
   
   The expected output is to have a shuffled version of `np.arange(num)`. This is the behavior of native numpy. 
   
   
   ## To Reproduce
   
   ```python
   from mxnet import np
   import numpy as npy
   
   np.random.choice(10, size=10, replace=False)
   
   # array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], dtype=int64)
   
   npy.random.choice(10, size=10, replace=False)
   
   # array([7, 3, 0, 1, 5, 4, 9, 8, 6, 2])
   
   ````
   
   ## Environment
   
   Mxnet 1.7


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@mxnet.apache.org
For additional commands, e-mail: issues-help@mxnet.apache.org


[GitHub] [incubator-mxnet] xidulu commented on issue #19423: Unexpected behavior of np.random.choice

Posted by GitBox <gi...@apache.org>.
xidulu commented on issue #19423:
URL: https://github.com/apache/incubator-mxnet/issues/19423#issuecomment-716293493


   @dibgerge 
   
   I believe there exists a bug in my implementation.
   
   You could temporarily use `np.random.shuffle` as a work around.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@mxnet.apache.org
For additional commands, e-mail: issues-help@mxnet.apache.org


[GitHub] [incubator-mxnet] xidulu commented on issue #19423: Unexpected behavior of np.random.choice

Posted by GitBox <gi...@apache.org>.
xidulu commented on issue #19423:
URL: https://github.com/apache/incubator-mxnet/issues/19423#issuecomment-720513603


   @sxjscience 
   Unfortunately, I do not have enough free time to look into this issue until this weekend. Also, I don't have computation resources for debugging the Op. But I could still provide help and information regarding the information as much as I could.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@mxnet.apache.org
For additional commands, e-mail: issues-help@mxnet.apache.org


[GitHub] [incubator-mxnet] sxjscience commented on issue #19423: Unexpected behavior of np.random.choice

Posted by GitBox <gi...@apache.org>.
sxjscience commented on issue #19423:
URL: https://github.com/apache/incubator-mxnet/issues/19423#issuecomment-720284678


   @xidulu Would you have time to fix it? This is an important random op.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@mxnet.apache.org
For additional commands, e-mail: issues-help@mxnet.apache.org