提交 12c78b33 authored 作者: Frederic Bastien's avatar Frederic Bastien

Fix flake8

上级 4405d79a
...@@ -63,7 +63,7 @@ def test_composite_elemwise_float16(): ...@@ -63,7 +63,7 @@ def test_composite_elemwise_float16():
tensor.cast(w, 'float16') - tensor.cast(w, 'float16') -
tensor.constant(numpy.float16(1.0))) tensor.constant(numpy.float16(1.0)))
f = theano.function([w, x, y], o, mode=mode_with_gpu) theano.function([w, x, y], o, mode=mode_with_gpu)
v = theano.tensor.vector(dtype='uint8') v = theano.tensor.vector(dtype='uint8')
w = theano.tensor.vector(dtype='float16') w = theano.tensor.vector(dtype='float16')
...@@ -72,7 +72,7 @@ def test_composite_elemwise_float16(): ...@@ -72,7 +72,7 @@ def test_composite_elemwise_float16():
z = theano.tensor.vector(dtype='float16') z = theano.tensor.vector(dtype='float16')
o = tensor.switch(v, tensor.mul(w, x, y), z) o = tensor.switch(v, tensor.mul(w, x, y), z)
f = theano.function([v, w, x, y, z], o, mode=mode_with_gpu) theano.function([v, w, x, y, z], o, mode=mode_with_gpu)
class test_GpuDimShuffle(test_elemwise.test_DimShuffle): class test_GpuDimShuffle(test_elemwise.test_DimShuffle):
......
...@@ -93,12 +93,8 @@ class test_composite(unittest.TestCase): ...@@ -93,12 +93,8 @@ class test_composite(unittest.TestCase):
y = float16() y = float16()
z = float16() z = float16()
o = switch(v, mul(w, x, y), z) c = switch(v, mul(w, x, y), z)
cz = Composite([x, y], [tanh(x + cast(y, 'float16'))])
c = Composite([w, x, y], [cz(x, y) - cz(x, y)**2 +
cast(x, 'int16') + cast(x, 'float32') +
cast(w, 'float16') -
constant(np.float16(1.0))])
assert has_f16(c) assert has_f16(c)
nc = c.clone_float32() nc = c.clone_float32()
assert not has_f16(nc) assert not has_f16(nc)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论