提交 d31922cf authored 作者: Tanjay94's avatar Tanjay94

Fixed norm tests.

上级 653c8484
......@@ -637,41 +637,20 @@ class Matrix_power():
self.assertRaises(ValueError, f, a)
class T_NormTests(unittest.TestCase):
try:
def test_wrong_type_of_ord_for_vector(self):
self.assertRaises(ValueError, norm, [2,1],'fro',0)
except TypeError:
raise SkipTest('Your numpy version is outdated.')
try:
def test_wrong_type_of_ord_for_vector_in_matrix(self):
self.assertRaises(ValueError, norm, [[2,1],[3,4]],'fro',0)
except TypeError:
raise SkipTest('Your numpy version is outdated.')
try:
def test_wrong_type_of_ord_for_vector_in_tensor(self):
self.assertRaises(ValueError, norm, [[[2,1],[3,4]],[[6,5],[7,8]]],'fro',0)
except TypeError:
raise SkipTest('Your numpy version is outdated.')
try:
def test_wrong_type_of_ord_for_matrix(self):
self.assertRaises(ValueError, norm, [[2,1],[3,4]],0,None)
except TypeError:
raise SkipTest('Your numpy version is outdated.')
try:
def test_wrong_type_of_ord_for_matrix_in_tensor(self):
self.assertRaises(ValueError, norm, [[[2,1],[3,4]],[[6,5],[7,8]]],0,None)
except TypeError:
raise SkipTest('Your numpy version is outdated.')
try:
def test_non_tensorial_input(self):
self.assertRaises(ValueError, norm, 3, None, None)
except TypeError:
raise SkipTest('Your numpy version is outdated.')
try:
def test_no_enough_dimensions(self):
self.assertRaises(ValueError, norm, [[2,1],[3,4]], None, 3)
except TypeError:
raise SkipTest('Your numpy version is outdated.')
try:
def test_numpy_compare(self):
rng = numpy.random.RandomState(utt.fetch_seed())
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论