提交 f3afa55a authored 作者: Iban Harlouchet's avatar Iban Harlouchet

flake8 for theano/gof/tests/test_compute_test_value.py

上级 8cdeff01
...@@ -13,7 +13,6 @@ from theano import scalar ...@@ -13,7 +13,6 @@ from theano import scalar
from theano import tensor as T from theano import tensor as T
from theano.gof import Apply, Op from theano.gof import Apply, Op
from theano.gof import utils from theano.gof import utils
from theano.scan_module import scan
from theano.tensor.basic import _allclose from theano.tensor.basic import _allclose
...@@ -236,7 +235,7 @@ class TestComputeTestValue(unittest.TestCase): ...@@ -236,7 +235,7 @@ class TestComputeTestValue(unittest.TestCase):
orig_compute_test_value = theano.config.compute_test_value orig_compute_test_value = theano.config.compute_test_value
try: try:
theano.config.compute_test_value = 'raise' theano.config.compute_test_value = 'raise'
#theano.config.compute_test_value = 'warn' # theano.config.compute_test_value = 'warn'
k = T.iscalar("k") k = T.iscalar("k")
A = T.vector("A") A = T.vector("A")
k.tag.test_value = 3 k.tag.test_value = 3
...@@ -281,7 +280,7 @@ class TestComputeTestValue(unittest.TestCase): ...@@ -281,7 +280,7 @@ class TestComputeTestValue(unittest.TestCase):
non_sequences=A, non_sequences=A,
n_steps=k) n_steps=k)
assert False assert False
except ValueError as e: except ValueError:
# Get traceback # Get traceback
tb = sys.exc_info()[2] tb = sys.exc_info()[2]
# Get frame info 4 layers up # Get frame info 4 layers up
...@@ -406,6 +405,6 @@ class TestComputeTestValue(unittest.TestCase): ...@@ -406,6 +405,6 @@ class TestComputeTestValue(unittest.TestCase):
init_Mu1 = theano.shared( init_Mu1 = theano.shared(
numpy.zeros((5,), dtype=config.floatX)).dimshuffle('x', 0) numpy.zeros((5,), dtype=config.floatX)).dimshuffle('x', 0)
f = theano.function([], outputs=[init_Mu1]) theano.function([], outputs=[init_Mu1])
finally: finally:
theano.config.compute_test_value = orig_compute_test_value theano.config.compute_test_value = orig_compute_test_value
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论