提交 9f85a80e authored 作者: Roy Xue's avatar Roy Xue 提交者: Lijun Xue

Commit Fixes

Add doctoring of profiling vm.py code fix
上级 54d8f896
......@@ -14,6 +14,9 @@ from theano.ifelse import ifelse
class Test_profiling(unittest.TestCase):
"""
Test of Theano profiling with min_peak_memory=True
"""
def test_profiling(self):
......
......@@ -921,7 +921,7 @@ class VM_Linker(link.LocalLinker):
origin = view_of.get(ins, ins)
view_of[out] = origin
viewed_by[origin].append(out)
idx_o += 1
idx_o += 1
for ins in node.inputs:
assert not (ins in view_of and viewed_by[ins])
......@@ -931,7 +931,7 @@ class VM_Linker(link.LocalLinker):
# where gc
for i in range(idx + 1, len(order)):
for outs in order[i].outputs:
if outs.ndim == 0:
if outs.ndim == 0 and out not in viewed_by.values():
reuse_outs.append(outs)
elif ins in view_of:
origin = view_of[ins]
......@@ -942,16 +942,13 @@ class VM_Linker(link.LocalLinker):
#where gc
for i in range(idx + 1, len(order)):
for outs in order[i].outputs:
if outs.ndim == 0:
if outs.ndim == 0 and out not in viewed_by.values():
reuse_outs.append(outs)
if reuse_outs:
# if reusable output variable exists
reallocated_ins.add(ins)
import pdb; pdb.set_trace()
for node in order:
try:
thunks.append(node.op.make_thunk(node,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论