提交 7cb9d724 authored 作者: Iban Harlouchet's avatar Iban Harlouchet

flake8 for theano/gof/tests/test_link.py

上级 76d15910
...@@ -10,7 +10,7 @@ from theano.gof.type import Type ...@@ -10,7 +10,7 @@ from theano.gof.type import Type
from theano.gof.op import Op from theano.gof.op import Op
from theano.gof import fg from theano.gof import fg
from theano.gof.link import * from theano.gof.link import * # noqa
from theano.compat import cmp from theano.compat import cmp
...@@ -33,7 +33,7 @@ def double(name): ...@@ -33,7 +33,7 @@ def double(name):
class MyOp(Op): class MyOp(Op):
__props__ = ("nin", "name", "impl") __props__ = ("nin", "name", "impl")
def __init__(self, nin, name, impl=None): def __init__(self, nin, name, impl=None):
self.nin = nin self.nin = nin
self.name = name self.name = name
...@@ -178,8 +178,11 @@ def test_sort_schedule_fn(): ...@@ -178,8 +178,11 @@ def test_sort_schedule_fn():
import theano import theano
from theano.gof.sched import sort_schedule_fn, make_depends from theano.gof.sched import sort_schedule_fn, make_depends
x = theano.tensor.matrix('x') x = theano.tensor.matrix('x')
y = theano.tensor.dot(x[:5]*2, x.T+1).T y = theano.tensor.dot(x[:5] * 2, x.T + 1).T
str_cmp = lambda a, b: cmp(str(a), str(b)) # lexicographical sort
def str_cmp(a, b):
return cmp(str(a), str(b)) # lexicographical sort
linker = theano.OpWiseCLinker(schedule=sort_schedule_fn(str_cmp)) linker = theano.OpWiseCLinker(schedule=sort_schedule_fn(str_cmp))
mode = theano.Mode(linker=linker) mode = theano.Mode(linker=linker)
f = theano.function((x,), (y,), mode=mode) f = theano.function((x,), (y,), mode=mode)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论