提交 400390fa authored 作者: David Warde-Farley's avatar David Warde-Farley

Fix shape behaviour of rand_from_dtype. Oops.

上级 8d57b16e
......@@ -853,11 +853,11 @@ ALL_DTYPES = ('int8', 'int16', 'int32', 'int64',
def rand_of_dtype(shape, dtype):
if 'int' in dtype:
return randint(shape).astype(dtype)
return randint(*shape).astype(dtype)
elif 'float' in dtype:
return rand(shape).astype(dtype)
return rand(*shape).astype(dtype)
elif 'complex' in dtype:
return randcomplex(shape).astype(dtype)
return randcomplex(*shape).astype(dtype)
else:
raise TypeError()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论