minpy icon indicating copy to clipboard operation
minpy copied to clipboard

Uniform sampler failed

Open wddabc opened this issue 8 years ago • 2 comments

Mentioned in #158, but should be a separate issue: The sample code

import minpy
print minpy.numpy.random.uniform(low=-1., high=1., size=(2,3))

triggered

mxnet/python/mxnet/base.pyc in check_call(ret) 73 """ 74 if ret != 0: ---> 75 raise MXNetError(py_str(_LIB.MXGetLastError())) 76 77 if sys.version_info[0] < 3:

MXNetError: Cannot find argument 'size', Possible Arguments:

low : float, optional, default=0 The lower bound of distribution high : float, optional, default=1 The upper bound of distribution shape : Shape(tuple), optional, default=() The shape of the output ctx : string, optional, default='' Context of output, in format cpu|gpu|cpu_pinned.Only used for imperative calls. dtype : int, optional, default='0' DType of the output , in operator uniform(name="", size="(2, 3)", low="-1.0", high="1.0")

wddabc avatar Mar 12 '17 21:03 wddabc

This is an mxnet error. It uses shape rather than size argument. Try:

minpy.numpy.random.uniform(low=-1, high=1, shape=(2,3))

jermainewang avatar Mar 12 '17 23:03 jermainewang

Thanks. It works. But I think this issue should be remained open until it comforms to numpy.

wddabc avatar Mar 13 '17 01:03 wddabc