提交 5ec4c302 authored 作者: abergeron's avatar abergeron

Merge pull request #2385 from nouiz/small

Crash fix and change scan.allow_gc default.
...@@ -667,14 +667,15 @@ class ProfileStats(object): ...@@ -667,14 +667,15 @@ class ProfileStats(object):
v = out.type.get_size(sh) v = out.type.get_size(sh)
sum_dense += v sum_dense += v
else: else:
v = 'Unknown' v = 0 # 'Unknown'
else: else:
v = 'Variable isnt created' v = 0 # 'Variable isnt created'
var_mem[out] = v var_mem[out] = v
fct_memory[node.fgraph][node].append(v) fct_memory[node.fgraph][node].append(v)
fct_shapes[node.fgraph][node].append(sh) fct_shapes[node.fgraph][node].append(sh)
node_mem[node] = sum_dense node_mem[node] = sum_dense
del v
# Find the function that used the most of that statistic # Find the function that used the most of that statistic
max_sum_size = 0 max_sum_size = 0
......
...@@ -157,7 +157,7 @@ N.B.: ...@@ -157,7 +157,7 @@ N.B.:
# If the op was compiled, print the optimized version. # If the op was compiled, print the optimized version.
outputs = s.owner.op.fn.maker.fgraph.outputs outputs = s.owner.op.fn.maker.fgraph.outputs
else: else:
outputs = s.owner.op.output outputs = s.owner.op.outputs
for idx, i in enumerate(outputs): for idx, i in enumerate(outputs):
if hasattr(i, 'owner') and hasattr(i.owner, 'op'): if hasattr(i, 'owner') and hasattr(i.owner, 'op'):
if isinstance(i.owner.op, theano.scan_module.scan_op.Scan): if isinstance(i.owner.op, theano.scan_module.scan_op.Scan):
......
...@@ -40,8 +40,8 @@ _logger = logging.getLogger('theano.scan_module.scan_op') ...@@ -40,8 +40,8 @@ _logger = logging.getLogger('theano.scan_module.scan_op')
from theano.configparser import AddConfigVar, BoolParam from theano.configparser import AddConfigVar, BoolParam
AddConfigVar('scan.allow_gc', AddConfigVar('scan.allow_gc',
"Allow/disallow gc inside of Scan (default: config.allow_gc)", "Allow/disallow gc inside of Scan (default: True)",
BoolParam(lambda: config.allow_gc)) BoolParam(True))
class Scan(PureOp): class Scan(PureOp):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论