提交 8ef9a3f0 authored 作者: Frederic Bastien's avatar Frederic Bastien

backport test to python24

上级 318dbf63
...@@ -654,6 +654,7 @@ class T_max_and_argmax(unittest.TestCase): ...@@ -654,6 +654,7 @@ class T_max_and_argmax(unittest.TestCase):
_logger = logging.getLogger('theano.gof.opt') _logger = logging.getLogger('theano.gof.opt')
oldlevel = _logger.getEffectiveLevel() oldlevel = _logger.getEffectiveLevel()
_logger.setLevel(logging.CRITICAL) _logger.setLevel(logging.CRITICAL)
try:
try: try:
eval_outputs(max_and_argmax(n,3)) eval_outputs(max_and_argmax(n,3))
assert False assert False
...@@ -665,6 +666,7 @@ class T_max_and_argmax(unittest.TestCase): ...@@ -665,6 +666,7 @@ class T_max_and_argmax(unittest.TestCase):
n = as_tensor_variable(numpy.random.rand(2,3)) n = as_tensor_variable(numpy.random.rand(2,3))
old_stderr = sys.stderr old_stderr = sys.stderr
sys.stderr = StringIO.StringIO() sys.stderr = StringIO.StringIO()
try:
try: try:
eval_outputs(max_and_argmax(n,-3)) eval_outputs(max_and_argmax(n,-3))
assert False assert False
...@@ -725,6 +727,7 @@ class T_subtensor(unittest.TestCase): ...@@ -725,6 +727,7 @@ class T_subtensor(unittest.TestCase):
_logger = logging.getLogger('theano.gof.opt') _logger = logging.getLogger('theano.gof.opt')
oldlevel = _logger.getEffectiveLevel() oldlevel = _logger.getEffectiveLevel()
_logger.setLevel(logging.CRITICAL) _logger.setLevel(logging.CRITICAL)
try:
try: try:
tval = eval_outputs([t]) tval = eval_outputs([t])
assert 0 assert 0
...@@ -802,6 +805,7 @@ class T_subtensor(unittest.TestCase): ...@@ -802,6 +805,7 @@ class T_subtensor(unittest.TestCase):
_logger = logging.getLogger('theano.gof.opt') _logger = logging.getLogger('theano.gof.opt')
oldlevel = _logger.getEffectiveLevel() oldlevel = _logger.getEffectiveLevel()
_logger.setLevel(logging.CRITICAL) _logger.setLevel(logging.CRITICAL)
try:
try: try:
tval = eval_outputs([t]) tval = eval_outputs([t])
assert 0 assert 0
...@@ -815,6 +819,7 @@ class T_subtensor(unittest.TestCase): ...@@ -815,6 +819,7 @@ class T_subtensor(unittest.TestCase):
self.failUnless(isinstance(t.owner.op, Subtensor)) self.failUnless(isinstance(t.owner.op, Subtensor))
old_stderr = sys.stderr old_stderr = sys.stderr
sys.stderr = StringIO.StringIO() sys.stderr = StringIO.StringIO()
try:
try: try:
tval = eval_outputs([t]) tval = eval_outputs([t])
except Exception, e: except Exception, e:
...@@ -1496,6 +1501,7 @@ class t_dot(unittest.TestCase): ...@@ -1496,6 +1501,7 @@ class t_dot(unittest.TestCase):
_logger = logging.getLogger('theano.gof.opt') _logger = logging.getLogger('theano.gof.opt')
oldlevel = _logger.getEffectiveLevel() oldlevel = _logger.getEffectiveLevel()
_logger.setLevel(logging.CRITICAL) _logger.setLevel(logging.CRITICAL)
try:
try: try:
tz = eval_outputs([z]) tz = eval_outputs([z])
assert False # should have raised exception assert False # should have raised exception
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论