提交 e2c53ecf authored 作者: Frederic Bastien's avatar Frederic Bastien

Tell in the profile mode how to enable the memory profiling if it is disabled.

上级 d76d1120
...@@ -411,7 +411,10 @@ class ProfileMode(Mode): ...@@ -411,7 +411,10 @@ class ProfileMode(Mode):
apply_time, op_cimpl, message, outputs_size, apply_time, op_cimpl, message, outputs_size,
other_time) other_time)
if outputs_size: if not outputs_size:
print """\nProfile of Theano intermediate memory disabled.
To enabled, put the Theano flag ProfileMode.profile_memory to True."""
else:
fct_memory={}#env->dict(node->(outputs size)) fct_memory={}#env->dict(node->(outputs size))
var_mem = {} var_mem = {}
for node,val in outputs_size.items(): for node,val in outputs_size.items():
...@@ -421,6 +424,7 @@ class ProfileMode(Mode): ...@@ -421,6 +424,7 @@ class ProfileMode(Mode):
var_mem[out]=v var_mem[out]=v
print print
print "Profile of Theano functions memory:" print "Profile of Theano functions memory:"
print "(This check only the output of each apply node. It don't check the temporary memory used by the op in the apply node.)"
nb_skipped = 0 nb_skipped = 0
for env,nodes_mem in fct_memory.iteritems(): for env,nodes_mem in fct_memory.iteritems():
size_sum=sum([sum(val) for key,val in nodes_mem.iteritems()]) size_sum=sum([sum(val) for key,val in nodes_mem.iteritems()])
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论