提交 6421efb0 authored 作者: Olivier Delalleau's avatar Olivier Delalleau

PEP8

上级 bd1bdc44
......@@ -584,14 +584,21 @@ 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
for a, t in apply_time.iteritems():
node = a[1]
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 64, and are the same for both inputs. Currently they are:",[i.type for i in node.inputs]
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])
printed_tip = True
#tip 5
......@@ -599,9 +606,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:
......
......@@ -999,16 +999,25 @@ if 0: # old code still to be ported from ProfileMode
#tip 4
for a, t in apply_time.iteritems():
node = a
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 that is faster. Make sure the inputs are float32 or 64 and are the same for both input. Currently they are:",[i.type for i in node.inputs]
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 that 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])
#tip 5
for a, t in apply_time.iteritems():
node = a
if isinstance(node.op, RandomFunction):
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 seam 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 seams to work correctly.")
if config.device.startswith("gpu"):
print " - MRG_RandomStreams is the only random number supported on the GPU."
print (" - MRG_RandomStreams is the only random number"
" supported on the GPU.")
break
def print_summary(self,
......
......@@ -287,7 +287,6 @@ class Stack(VM):
if self.allow_gc and self.dependencies is None:
raise ValueError("Must set dependencies when using GC")
def run_thunk_of_node(self, node):
"""Run the thunk corresponding to Apply instance `node`
......@@ -661,7 +660,9 @@ class VM_Linker(link.LocalLinker):
pre_call_clear = [storage_map[v] for v in self.no_recycling]
if self.callback is not None or (config.profile and config.profile_memory):
if (self.callback is not None or
(config.profile and config.profile_memory)):
if self.use_cloop and self.callback is not None:
logger.warn('CVM does not support callback, using Stack VM.')
if self.use_cloop and config.profile_memory:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论