提交 0a904644 authored 作者: Chiheb Trabelsi's avatar Chiheb Trabelsi

test_driver has been modified in order to respect the flake8 style.

上级 19a6bd40
...@@ -6,7 +6,7 @@ import theano ...@@ -6,7 +6,7 @@ import theano
try: try:
from nose.plugins.skip import SkipTest from nose.plugins.skip import SkipTest
import theano.sandbox.cuda as cuda_ndarray import theano.sandbox.cuda as cuda_ndarray
if cuda_ndarray.cuda_available == False: if cuda_ndarray.cuda_available is False:
raise SkipTest('Optional package cuda disabled') raise SkipTest('Optional package cuda disabled')
except ImportError: except ImportError:
# To have the GPU back-end work without nose, we need this file to # To have the GPU back-end work without nose, we need this file to
...@@ -33,8 +33,9 @@ def test_nvidia_driver1(): ...@@ -33,8 +33,9 @@ def test_nvidia_driver1():
topo = f.maker.fgraph.toposort() topo = f.maker.fgraph.toposort()
assert len(topo) == 2 assert len(topo) == 2
if sum(isinstance(node.op, B.GpuCAReduce) for node in topo) != 1: if sum(isinstance(node.op, B.GpuCAReduce) for node in topo) != 1:
msg = '\n\t'.join(['Expected exactly one occurrence of GpuCAReduce ' + msg = '\n\t'.join(
'but got:']+[str(app) for app in topo]) ['Expected exactly one occurrence of GpuCAReduce ' +
'but got:'] + [str(app) for app in topo])
raise AssertionError(msg) raise AssertionError(msg)
if not numpy.allclose(f(), a.sum()): if not numpy.allclose(f(), a.sum()):
raise Exception("The nvidia driver version installed with this OS " raise Exception("The nvidia driver version installed with this OS "
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论