Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

nd.random.uniform() FP exception when called with bad shape #16275

Answered by xidulu
michaelkr asked this question in Q&A
Discussion options

You must be logged in to vote

@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 #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))

Replies: 8 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by szha
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants
Converted from issue

This discussion was converted from issue #16275 on September 05, 2020 19:32.