Mx.nd.multinomial() output the same results each running?

from mxnet import nd
prob_each = nd.array([0.5,0.5])#.reshape(1,2)
for k in range(3):
a = nd.random.multinomial(prob_each,shape=(2,1)).asnumpy()
print a,’-’

hi all i run codes above many times with all results are 1.
but i think it should output 0 or 1 randomly?

It does look strange. I have created an issue on your behalf: https://github.com/apache/incubator-mxnet/issues/14183 Hopefully, someone from the community will pick it up.

In the meantime, I can only recommend using numpy to draw samples from the multinominal distribution and then convert it into NDArray by mx.nd.array(np_array).