提交 cf0d8464 authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Fix python3 problems.

上级 99d29798
...@@ -661,9 +661,9 @@ Test them first, as they are not guaranteed to always provide a speedup.""") ...@@ -661,9 +661,9 @@ Test them first, as they are not guaranteed to always provide a speedup.""")
if not config.lib.amdlibm and any([exp_float32_op(a.op) and if not config.lib.amdlibm and any([exp_float32_op(a.op) and
a.inputs[0].dtype == 'float32' a.inputs[0].dtype == 'float32'
for i, a in apply_time]): for i, a in apply_time]):
print (" - With the default gcc libm, exp in float32 is slower " print(" - With the default gcc libm, exp in float32 is slower "
"than in float64! Try Theano flag floatX=float64, or " "than in float64! Try Theano flag floatX=float64, or "
"install amdlibm and set the theano flags lib.amdlibm=True") "install amdlibm and set the theano flags lib.amdlibm=True")
printed_tip = True printed_tip = True
# tip 4 # tip 4
...@@ -672,11 +672,11 @@ Test them first, as they are not guaranteed to always provide a speedup.""") ...@@ -672,11 +672,11 @@ Test them first, as they are not guaranteed to always provide a speedup.""")
if (isinstance(node.op, T.Dot) and if (isinstance(node.op, T.Dot) and
all([len(i.type.broadcastable) == 2 all([len(i.type.broadcastable) == 2
for i in node.inputs])): for i in node.inputs])):
print((" - You have a dot operation that was not optimized to" print(" - You have a dot operation that was not optimized to"
" dot22 (which is faster). Make sure the inputs are " " dot22 (which is faster). Make sure the inputs are "
"float32 or float64, and are the same for both inputs. " "float32 or float64, and are the same for both inputs. "
"Currently they are: %s" % "Currently they are: %s" %
[i.type for i in node.inputs])) [i.type for i in node.inputs])
printed_tip = True printed_tip = True
# tip 5 # tip 5
...@@ -684,13 +684,13 @@ Test them first, as they are not guaranteed to always provide a speedup.""") ...@@ -684,13 +684,13 @@ Test them first, as they are not guaranteed to always provide a speedup.""")
node = a[1] node = a[1]
if isinstance(node.op, RandomFunction): if isinstance(node.op, RandomFunction):
printed_tip = True printed_tip = True
print (" - Replace the default random number generator by " print(" - Replace the default random number generator by "
"'from theano.sandbox.rng_mrg import MRG_RandomStreams " "'from theano.sandbox.rng_mrg import MRG_RandomStreams "
"as RandomStreams', as this is is faster. It is still " "as RandomStreams', as this is is faster. It is still "
"experimental, but seems to work correctly.") "experimental, but seems to work correctly.")
if config.device.startswith("gpu"): if config.device.startswith("gpu"):
print (" - MRG_RandomStreams is the only random number" print(" - MRG_RandomStreams is the only random number"
" generator supported on the GPU.") " generator supported on the GPU.")
break break
if not printed_tip: if not printed_tip:
......
...@@ -312,7 +312,7 @@ class SequenceDB(DB): ...@@ -312,7 +312,7 @@ class SequenceDB(DB):
positions = list(self.__position__.items()) positions = list(self.__position__.items())
def c(a, b): def c(a, b):
return cmp(a[1], b[1]) return ((a > b) - (a < b))
positions.sort(c) positions.sort(c)
print(" position", positions, file=stream) print(" position", positions, file=stream)
......
...@@ -6,7 +6,6 @@ from nose.plugins.skip import SkipTest ...@@ -6,7 +6,6 @@ from nose.plugins.skip import SkipTest
import os import os
from fnmatch import fnmatch from fnmatch import fnmatch
import theano import theano
from theano.compat import PY3
try: try:
import flake8.engine import flake8.engine
import flake8.main import flake8.main
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论