提交 351d455b authored 作者: Frederic's avatar Frederic

Make test pass when allow_gc=False

上级 6469c740
import copy
import gc import gc
import numpy as np import numpy as np
...@@ -18,6 +19,11 @@ if theano.config.mode == 'FAST_COMPILE': ...@@ -18,6 +19,11 @@ if theano.config.mode == 'FAST_COMPILE':
else: else:
mode_with_gpu = theano.compile.mode.get_default_mode().including('gpu') mode_with_gpu = theano.compile.mode.get_default_mode().including('gpu')
# The GC need to be enabled for those tests to work correctly.
if mode_with_gpu.linker.allow_gc != True:
mode_with_gpu.linker = copy.copy(mode_with_gpu.linker)
mode_with_gpu.linker.allow_gc = True
def freemem(extra_alloc=0): def freemem(extra_alloc=0):
""" """
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论