提交 d659b59e authored 作者: Frederic's avatar Frederic

Correctly do version comparison: fix #136

上级 6bdb5854
from pkg_resources import parse_version as V
import numpy import numpy
import theano import theano
...@@ -6,7 +8,7 @@ from theano.tensor.basic import _allclose ...@@ -6,7 +8,7 @@ from theano.tensor.basic import _allclose
try: try:
import scipy import scipy
if scipy.__version__ < '0.7': if V(scipy.__version__) < V('0.7'):
raise ImportError() raise ImportError()
use_scipy = True use_scipy = True
except ImportError: except ImportError:
......
from pkg_resources import parse_version as V
import sys import sys
try: try:
import scipy import scipy
enable_sparse = scipy.__version__ >= '0.7' enable_sparse = V(scipy.__version__) >= V('0.7')
if not enable_sparse: if not enable_sparse:
sys.stderr.write("WARNING: scipy version = %s." sys.stderr.write("WARNING: scipy version = %s."
" We request version >=0.7.0 for the sparse code as it has" " We request version >=0.7.0 for the sparse code as it has"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论