提交 9b337b6a authored 作者: Frederic Bastien's avatar Frederic Bastien

Make test use less memory in DebugMode.

上级 fcbe563f
...@@ -57,11 +57,15 @@ class TestScanCheckpoint(unittest.TestCase): ...@@ -57,11 +57,15 @@ class TestScanCheckpoint(unittest.TestCase):
f = theano.function(inputs=[self.A, self.k], f = theano.function(inputs=[self.A, self.k],
outputs=self.grad_A, mode=mode_with_gpu) outputs=self.grad_A, mode=mode_with_gpu)
f_check = theano.function(inputs=[self.A, self.k], f_check = theano.function(inputs=[self.A, self.k],
outputs=self.grad_A_check, mode=mode_with_gpu) outputs=self.grad_A_check,
mode=mode_with_gpu)
free_gmem = theano.gpuarray.type._context_reg[None].free_gmem free_gmem = theano.gpuarray.type._context_reg[None].free_gmem
data = np.ones(free_gmem // 3000, dtype=np.float32) data = np.ones(free_gmem // 3000, dtype=np.float32)
# Check that it works with the checkpoints # Check that it works with the checkpoints
f_check(data, 1000) size = 1000
if isinstance(mode_with_gpu, theano.compile.DebugMode):
size = 100
f_check(data, size)
# Check that the basic scan fails in that case # Check that the basic scan fails in that case
# Skip that check in DebugMode, as it can fail in different ways # Skip that check in DebugMode, as it can fail in different ways
if not isinstance(mode_with_gpu, theano.compile.DebugMode): if not isinstance(mode_with_gpu, theano.compile.DebugMode):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论