提交 d7286bf8 authored 作者: Olivier Delalleau's avatar Olivier Delalleau

Bug fix with random streams under Windows

上级 c739e3a5
...@@ -309,7 +309,9 @@ def permutation_helper(random_state, n, shape): ...@@ -309,7 +309,9 @@ def permutation_helper(random_state, n, shape):
""" """
# n should be a 0-dimension array # n should be a 0-dimension array
assert n.shape == () assert n.shape == ()
n = n.item() # Note that it is important to convert `n` into an integer, because if it
# is a long, the numpy permutation function will crash on Windows.
n = int(n.item())
out_shape = list(shape) out_shape = list(shape)
out_shape.append(n) out_shape.append(n)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论