提交 e1b37ea4 authored 作者: abergeron's avatar abergeron

Merge pull request #4240 from nouiz/test_wo_scipy

Fix test for release when scipy isn't there.
...@@ -32,6 +32,15 @@ from theano.scalar.basic_scipy import erfinv ...@@ -32,6 +32,15 @@ from theano.scalar.basic_scipy import erfinv
from theano.tensor.nnet.blocksparse import sparse_block_dot from theano.tensor.nnet.blocksparse import sparse_block_dot
from theano.sandbox.cuda.blocksparse import GpuSparseBlockGemv, GpuSparseBlockOuter from theano.sandbox.cuda.blocksparse import GpuSparseBlockGemv, GpuSparseBlockOuter
imported_scipy_special = False
try:
import scipy.special
imported_scipy_special = True
# Importing scipy.special may raise ValueError.
# See http://projects.scipy.org/scipy/ticket/1739
except (ImportError, ValueError):
pass
if theano.config.mode == 'FAST_COMPILE': if theano.config.mode == 'FAST_COMPILE':
mode_with_gpu = theano.compile.mode.get_mode('FAST_RUN').including('gpu') mode_with_gpu = theano.compile.mode.get_mode('FAST_RUN').including('gpu')
...@@ -753,7 +762,8 @@ def test_erfinvgpu(): ...@@ -753,7 +762,8 @@ def test_erfinvgpu():
assert isinstance(f.maker.fgraph.toposort()[1].op.scalar_op, assert isinstance(f.maker.fgraph.toposort()[1].op.scalar_op,
cuda.elemwise.ErfinvGPU) cuda.elemwise.ErfinvGPU)
xv = numpy.random.rand(7, 8).astype('float32') xv = numpy.random.rand(7, 8).astype('float32')
assert numpy.allclose(f(xv), f2(xv)) if imported_scipy_special:
assert numpy.allclose(f(xv), f2(xv))
def test_local_gpu_solve(): def test_local_gpu_solve():
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论