提交 d9cebfd1 authored 作者: Yann N. Dauphin's avatar Yann N. Dauphin

added check that matrix is unsorted in test

上级 2394140c
......@@ -675,6 +675,8 @@ class test_csm(unittest.TestCase):
# Sparse advanced indexing produces unsorted sparse matrices
a = as_sparse_variable(sp_types[format]([[1,2,1], [1,2,1],
[1,2,1], [1,2,1]], dtype=dtype)[list(reversed(range(4)))])
# Make sure it's unsorted
assert numpy.any(a.data.indices[:-1] > a.data.indices[1:])
f = theano.function([x, y, z, s], tensor.grad(tensor.sum(
dense_from_sparse(a * CSM(format)(x, y, z, s))), x))
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论