提交 32605f33 authored 作者: Frederic Bastien's avatar Frederic Bastien

disable theano.sparse when scipy version is too old. skip the test of…

disable theano.sparse when scipy version is too old. skip the test of theano.sparse in the same condition. This lower the number of nosetests when we won't use the sparse code.
上级 43fc2602
import sys,scipy
from basic import * enable_sparse=True
if not scipy.__version__.startswith('0.7.'):
sys.stderr.write("WARNING: scipy version = %s. We request version >=0.7.0 for the sparse code as it has bugs fixed in the sparse matrix code.\n" % scipy.__version__)
enable_sparse=False
if enable_sparse:
from basic import *
...@@ -29,10 +29,6 @@ _mtypes = [sparse.csc_matrix, sparse.csr_matrix] ...@@ -29,10 +29,6 @@ _mtypes = [sparse.csc_matrix, sparse.csr_matrix]
#* new class ``bsr_matrix`` : the Block CSR format #* new class ``bsr_matrix`` : the Block CSR format
_mtype_to_str = {sparse.csc_matrix: "csc", sparse.csr_matrix: "csr"} _mtype_to_str = {sparse.csc_matrix: "csc", sparse.csr_matrix: "csr"}
import scipy
if not scipy.__version__.startswith('0.7.'):
sys.stderr.write("WARNING: scipy version = %s. We prefer version >=0.7.0 because it has bugs fixed in the sparse matrix code.\n" % scipy.__version__)
def _is_sparse_variable(x): def _is_sparse_variable(x):
""" """
@rtype: boolean @rtype: boolean
......
import scipy.sparse import scipy.sparse
from theano.sparse import * from theano.sparse import *
from nose.plugins.skip import SkipTest
if enable_sparse == False:
raise SkipTest('Optional package sparse disabled')
import random import random
import unittest import unittest
import theano import theano
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论