提交 468fa2b9 authored 作者: Frederic's avatar Frederic

Fix crash in tests due to scipy 0.13 interface change in sparce matrix.

It used to support ndarray of 2 elements for idx, now it ask for a tuple.
上级 171397d4
......@@ -69,14 +69,16 @@ def random_lil(shape, dtype, nnz):
huge = 2 ** 30
for k in range(nnz):
# set non-zeros in random locations (row x, col y)
idx = numpy.random.random_integers(huge, size=len(shape)) % shape
idx = numpy.random.random_integers(huge, size=2) % shape
value = numpy.random.rand()
#if dtype *int*, value will always be zeros!
if "int" in dtype:
value = int(value * 100)
# The call to tuple is needed as scipy 0.13.1 do not support
# ndarray with lenght 2 as idx tuple.
rval.__setitem__(
idx,
value)
tuple(idx),
value)
return rval
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论