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/05/02 03:53:37 UTC
[GitHub] asitstands commented on issue #10768: Use numpy in RandomSampler
asitstands commented on issue #10768: Use numpy in RandomSampler
URL: https://github.com/apache/incubator-mxnet/pull/10768#issuecomment-385857579
Would you try this and provide the timings?
```python
def __iter__(self):
indices = mx.nd.arange(self._length, dtype='int32').reshape((1, self._length)) # may looks weird but anyway
mx.nd.random.shuffle(indices, out=indices)
indicies = indices[0].asnumpy()
return iter(indicies)
```
----------------------------------------------------------------
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