提交 034bb0d2 authored 作者: nouiz's avatar nouiz

Merge pull request #733 from bouchnic/sparse_opt

Fix bug from local_csm_grad_c in mode FAST_COMPILE.
...@@ -40,6 +40,10 @@ def test_local_csm_grad_c(): ...@@ -40,6 +40,10 @@ def test_local_csm_grad_c():
indices, indptr, shape = (tensor.ivector(), tensor.ivector(), indices, indptr, shape = (tensor.ivector(), tensor.ivector(),
tensor.ivector()) tensor.ivector())
mode = theano.compile.mode.get_default_mode() mode = theano.compile.mode.get_default_mode()
if theano.config.mode == 'FAST_COMPILE':
mode = theano.compile.Mode(linker='c|py', optimizer='fast_compile')
mode = mode.including("specialize", "local_csm_grad_c") mode = mode.including("specialize", "local_csm_grad_c")
for CS, cast in [(CSC, sp.csc_matrix), (CSR, sp.csr_matrix)]: for CS, cast in [(CSC, sp.csc_matrix), (CSR, sp.csr_matrix)]:
cost = tensor.sum(DenseFromSparse()(CS(data, indices, indptr, shape))) cost = tensor.sum(DenseFromSparse()(CS(data, indices, indptr, shape)))
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论