提交 1ace1445 authored 作者: Iban Harlouchet's avatar Iban Harlouchet

flake8 for theano/gof/tests/test_toolbox.py

上级 f3afa55a
......@@ -3,8 +3,8 @@ from theano.gof.graph import Variable, Apply
from theano.gof.type import Type
from theano.gof.op import Op
from theano.gof.fg import FunctionGraph, InconsistencyError
from theano.gof.toolbox import *
from theano.gof.fg import FunctionGraph
from theano.gof.toolbox import * # noqa
def as_variable(x):
......@@ -34,7 +34,7 @@ def MyVariable(name):
class MyOp(Op):
__props__ = ("nin", "name")
def __init__(self, nin, name):
self.nin = nin
self.name = name
......@@ -74,7 +74,7 @@ class TestNodeFinder:
assert hasattr(g, 'get_nodes')
for type, num in ((add, 3), (sigmoid, 3), (dot, 2)):
if not len([x for x in g.get_nodes(type)]) == num:
if not len([t for t in g.get_nodes(type)]) == num:
raise Exception("Expected: %i times %s" % (num, type))
new_e0 = add(y, z)
assert e0.owner in g.get_nodes(dot)
......@@ -83,8 +83,5 @@ class TestNodeFinder:
assert e0.owner not in g.get_nodes(dot)
assert new_e0.owner in g.get_nodes(add)
for type, num in ((add, 4), (sigmoid, 3), (dot, 1)):
if not len([x for x in g.get_nodes(type)]) == num:
if not len([t for t in g.get_nodes(type)]) == num:
raise Exception("Expected: %i times %s" % (num, type))
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论