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 2019/09/26 11:56:24 UTC

[GitHub] [incubator-mxnet] xidulu edited a comment on issue #16275: nd.random.uniform() FP exception when called with bad shape

xidulu edited a comment on issue #16275: nd.random.uniform() FP exception when called with bad shape
URL: https://github.com/apache/incubator-mxnet/issues/16275#issuecomment-535469564
 
 
   @michaelkr 
   What you are trying to create is something called "Zero-size tensor", which, as far as I'm concerned, is not supported by `mx.ndarray`, as the zero in the shape means unknown rather than a concrete number, see bullet 2 in https://github.com/apache/incubator-mxnet/issues/14253 for more details.
   However, the deep numpy API supports zero-size tensor, I'm not sure if the version installed using pip includes this feature, but if you build the latets version of mxnet from source, you could call the api like this:
   ```
   >>> from mxnet import np, npx
   >>> np.random.uniform(-1,1, (2,0))
   array([], shape=(2, 0))
   ```
   

----------------------------------------------------------------
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


With regards,
Apache Git Services