提交 3a3dde3d authored 作者: Frederic's avatar Frederic

Skip test when scipy isn't available

上级 b5a590e4
from __future__ import print_function
from itertools import count
import pickle
import unittest
import numpy
from itertools import count
from nose.plugins.skip import SkipTest
import numpy
from theano import (
sparse,
......@@ -361,6 +362,8 @@ class TestAutoName:
def test_sparsevariable(self):
# Get counter value
if not sparse.enable_sparse:
raise SkipTest('Optional package SciPy not installed')
autoname_id = next(Variable.__count__)
Variable.__count__ = count(autoname_id)
r1 = sparse.csc_matrix(name='x', dtype='float32')
......
......@@ -156,6 +156,8 @@ def test_transinv_to_invtrans():
def test_tag_solve_triangular():
if not imported_scipy:
raise SkipTest("Scipy needed for the Cholesky op.")
cholesky_lower = Cholesky(lower=True)
cholesky_upper = Cholesky(lower=False)
A = tensor.matrix('A')
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论