提交 bc109250 authored 作者: Frederic Bastien's avatar Frederic Bastien 提交者: Alexander Belopolsky

Make test work with python3

上级 3b9fdd10
...@@ -17,6 +17,7 @@ from theano.gof.python25 import any ...@@ -17,6 +17,7 @@ from theano.gof.python25 import any
from theano.tests import unittest_tools as utt from theano.tests import unittest_tools as utt
import theano.scalar.sharedvar import theano.scalar.sharedvar
from theano.gof.python25 import OrderedDict from theano.gof.python25 import OrderedDict
from theano.compat import PY3
from numpy.testing.noseclasses import KnownFailureTest from numpy.testing.noseclasses import KnownFailureTest
...@@ -3515,6 +3516,14 @@ def test_speed(): ...@@ -3515,6 +3516,14 @@ def test_speed():
t0 = time.time() t0 = time.time()
r_i = iter(r[1:]) r_i = iter(r[1:])
r_ii = iter(r[:-1]) r_ii = iter(r[:-1])
if PY3:
while True:
try:
tmp = next(r_i)
tmp += next(r_ii)
except StopIteration:
break
else:
while True: while True:
try: try:
tmp = r_i.next() tmp = r_i.next()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论