提交 db34bfe2 authored 作者: Frederic Bastien's avatar Frederic Bastien

flake8

上级 18b7518f
...@@ -3,13 +3,11 @@ import sys ...@@ -3,13 +3,11 @@ import sys
import unittest import unittest
from nose.plugins.skip import SkipTest from nose.plugins.skip import SkipTest
from nose.tools import assert_raises
import numpy as np import numpy as np
from six import reraise from six import reraise
from theano import config from theano import config
from theano import gof from theano import gof
from theano.gof.link import raise_with_op
import theano import theano
from theano.compat import exc_message from theano.compat import exc_message
from theano.compile import debugmode from theano.compile import debugmode
...@@ -258,6 +256,7 @@ def test_badoptimization_opt_err(): ...@@ -258,6 +256,7 @@ def test_badoptimization_opt_err():
inputs[-1])) inputs[-1]))
return [node.op(*inputs)] return [node.op(*inputs)]
return False return False
@gof.local_optimizer([theano.tensor.add]) @gof.local_optimizer([theano.tensor.add])
def insert_bad_dtype(node): def insert_bad_dtype(node):
if node.op == theano.tensor.add: if node.op == theano.tensor.add:
...@@ -296,7 +295,7 @@ def test_badoptimization_opt_err(): ...@@ -296,7 +295,7 @@ def test_badoptimization_opt_err():
assert 'insert_bad_dtype' in str(e) assert 'insert_bad_dtype' in str(e)
# Test that we can reraise the error with an extended message # Test that we can reraise the error with an extended message
try: try:
new_e = e.__class__("TTT"+str(e)) new_e = e.__class__("TTT" + str(e))
exc_type, exc_value, exc_trace = sys.exc_info() exc_type, exc_value, exc_trace = sys.exc_info()
exc_value = new_e exc_value = new_e
reraise(e.__class__, exc_value, exc_trace) reraise(e.__class__, exc_value, exc_trace)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论