提交 bcb86717 authored 作者: Pascal Lamblin's avatar Pascal Lamblin

Fix dtype of input.

Since csc_matrix's default dtype is floatX, the numpy value needs to have a compatible dtype.
上级 0fd30764
......@@ -470,7 +470,8 @@ def test_diag():
f = theano.function([m], d)
f2 = theano.function([m], d.shape)
for K in 1, 5:
np_matrix = numpy.asarray(numpy.reshape(range(K**2),(K,K)),dtype='float64')
np_matrix = numpy.asarray(numpy.reshape(range(K**2),(K,K)),
dtype=theano.config.floatX)
diag = numpy.diagonal(np_matrix)
sp_matrix = scipy.sparse.csc_matrix(np_matrix)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论