提交 ae01ef54 authored 作者: Pascal Lamblin's avatar Pascal Lamblin

Make the test actually run on GPU

Otherwise it is not actually testing anything.
上级 6477449a
...@@ -53,10 +53,11 @@ class TestScanCheckpoint(unittest.TestCase): ...@@ -53,10 +53,11 @@ class TestScanCheckpoint(unittest.TestCase):
"""Test that scan_checkpoint reduces memory usage.""" """Test that scan_checkpoint reduces memory usage."""
if None not in theano.gpuarray.type.list_contexts(): if None not in theano.gpuarray.type.list_contexts():
return unittest.SkipTest('Requires gpuarray backend.') return unittest.SkipTest('Requires gpuarray backend.')
from theano.gpuarray.tests.config import mode_with_gpu # noqa
f = theano.function(inputs=[self.A, self.k], f = theano.function(inputs=[self.A, self.k],
outputs=self.grad_A) 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) 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 = numpy.ones(free_gmem // 3000, dtype=numpy.float32) data = numpy.ones(free_gmem // 3000, dtype=numpy.float32)
# Check that it works with the checkpoints # Check that it works with the checkpoints
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论