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

better disabled test for the fixed memory leak.

上级 dbe16b7d
...@@ -1065,6 +1065,7 @@ class test_fusion(unittest.TestCase): ...@@ -1065,6 +1065,7 @@ class test_fusion(unittest.TestCase):
""" """
#TODO: disable the canonizer? #TODO: disable the canonizer?
fx = fmatrices('x') fx = fmatrices('x')
fy = fmatrices('y')
fxv = numpy.zeros(shp, dtype='float32')+ 2 fxv = numpy.zeros(shp, dtype='float32')+ 2
cases = [ cases = [
(fx,(fx),(fxv),'float32'),#1 (fx,(fx),(fxv),'float32'),#1
...@@ -1074,20 +1075,19 @@ class test_fusion(unittest.TestCase): ...@@ -1074,20 +1075,19 @@ class test_fusion(unittest.TestCase):
dl=[] dl=[]
v1=None v1=None
mode=compile.mode.Mode('c', 'merge') mode=compile.mode.Mode('c', 'merge')
#TODO: if mode is Mode('py','merge') then their is no memory leak!
from theano.compile.function_module import orig_function
for id, [g, sym_inputs, val_inputs, out_dtype] in enumerate(cases): for id, [g, sym_inputs, val_inputs, out_dtype] in enumerate(cases):
for zzzz in range(nb_repeat): for zzzz in range(nb_repeat):
v=numpy.zeros(shp, dtype=out_dtype) v=numpy.zeros(shp, dtype=out_dtype)
gc.collect();gc.collect();gc.collect() gc.collect();gc.collect();gc.collect()
# print 'v1',v1 # print 'v1',v1
# v1=weakref.ref(v) v1=weakref.ref(v)
out=shared_fn(v,'out')
pdb.set_trace() pdb.set_trace()
# f = function(sym_inputs,[],updates=[(out,out+g)],mode=mode) #f = orig_function([compile.In(fx),compile.In(variable=fy, value=None)],
# f = function([fx],[],updates=[(out,out+fx)],mode=mode) # [fy+fx],mode=mode)#no memory leak
# f = function([fx],out+fx,mode=mode) f = orig_function([compile.In(fx),compile.In(variable=fy, value=v)],
# f = compile.function([fx,out],[out+fx],mode=mode)#no memory leak. [fy+fx],mode=mode)#memory leak
f = compile.function([fx,compile.In(variable=out, value=out.container, mutable=None)],
[out+fx],mode=mode)#if mutable is True or False, their is a memory leak
del v del v
gc.collect();gc.collect();gc.collect() gc.collect();gc.collect();gc.collect()
pdb.set_trace() pdb.set_trace()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论