提交 7811658e authored 作者: Razvan Pascanu's avatar Razvan Pascanu

PEP8 fixed

上级 f5648722
...@@ -42,7 +42,7 @@ class test_ifelse(unittest.TestCase): ...@@ -42,7 +42,7 @@ class test_ifelse(unittest.TestCase):
x = tensor.vector('x') x = tensor.vector('x')
y = tensor.vector('y') y = tensor.vector('y')
c = tensor.iscalar('c') c = tensor.iscalar('c')
f = theano.function([c, x, y], 2*ifelse(c, x, y)) f = theano.function([c, x, y], 2 * ifelse(c, x, y))
rng = numpy.random.RandomState(utt.fetch_seed()) rng = numpy.random.RandomState(utt.fetch_seed())
xlen = rng.randint(200) xlen = rng.randint(200)
...@@ -52,8 +52,8 @@ class test_ifelse(unittest.TestCase): ...@@ -52,8 +52,8 @@ class test_ifelse(unittest.TestCase):
vy = numpy.asarray(rng.uniform(size=(ylen,)), theano.config.floatX) vy = numpy.asarray(rng.uniform(size=(ylen,)), theano.config.floatX)
assert numpy.all(x.op.inplace for x in f.maker.env.toposort() if assert numpy.all(x.op.inplace for x in f.maker.env.toposort() if
x.op == IfElse) x.op == IfElse)
assert numpy.allclose(vx*2, f(1, vx, vy)) assert numpy.allclose(vx * 2, f(1, vx, vy))
assert numpy.allclose(vy*2, f(0, vx, vy)) assert numpy.allclose(vy * 2, f(0, vx, vy))
def test_lazy_if_on_generics(self): def test_lazy_if_on_generics(self):
x = theano.generic() x = theano.generic()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论