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