提交 d03ed942 authored 作者: Frederic's avatar Frederic

Added a test for the fixed case.

上级 b474effc
...@@ -279,3 +279,29 @@ if run_memory_usage_tests: ...@@ -279,3 +279,29 @@ if run_memory_usage_tests:
time_linker('vmLinker_C', lambda : vm.VM_Linker(allow_gc=False, use_cloop=True)) time_linker('vmLinker_C', lambda : vm.VM_Linker(allow_gc=False, use_cloop=True))
class RunOnce(theano.Op):
def __init__(self):
self.nb_run = 0
def make_node(self, x):
return theano.Apply(self, [x], [x.type()])
def perform(self, node, inputs, outputs):
assert self.nb_run == 0
self.nb_run += 1
outputs[0][0] = inputs[0].copy()
def test_vm_gc():
"""This already caused a bug in the trunk of Theano.
The bug was introduced in the trunk the July 5, 2012 andfixed the
July 27
"""
pass
x = theano.tensor.vector()
p = RunOnce()(x)
f = theano.function([theano.In(x, mutable=True)], [p + 1, p + 2],
mode=theano.Mode(linker='vm_lazy'))
f([1,2,3])
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论