提交 92548e9e authored 作者: Tanjay94's avatar Tanjay94

Fixed SkipTest placement in order to keep other test in norm test.

上级 b53610f8
......@@ -904,9 +904,8 @@ eig = Eig()
class SVD(Op):
"""
See doc in the docstring of the function just after this class.
"""
# See doc in the docstring of the function just after this class.
_numop = staticmethod(numpy.linalg.svd)
def __init__(self, full_matrices=True, compute_uv=True):
......
......@@ -182,18 +182,12 @@ def test_qr_modes():
A = tensor.matrix("A", dtype=theano.config.floatX)
a = rng.rand(4, 4).astype(theano.config.floatX)
try:
numpy.linalg.qr(a, "complete")
except TypeError, e:
assert "name 'complete' is not defined" in str(e)
raise SkipTest
f = function([A], qr(A))
t_qr = f(a)
n_qr = numpy.linalg.qr(a)
assert _allclose(n_qr, t_qr)
for mode in ["reduced", "complete", "r", "raw", "full", "economic"]:
for mode in ["reduced", "r", "raw", "full", "economic"]:
f = function([A], qr(A, mode))
t_qr = f(a)
n_qr = numpy.linalg.qr(a, mode)
......@@ -203,6 +197,14 @@ def test_qr_modes():
else:
assert _allclose(n_qr, t_qr)
try:
n_qr = numpy.linalg.qr(a, "complete")
f = function([A], qr(A, "complete"))
t_qr = f(a)
assert _allclose(n_qr, t_qr)
except TypeError, e:
assert "name 'complete' is not defined" in str(e)
raise SkipTest
def test_svd():
rng = numpy.random.RandomState(utt.fetch_seed())
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论