提交 0efb754f authored 作者: Frederic's avatar Frederic

Add tests for ifelse on the gpu.

上级 c45ca839
...@@ -11,6 +11,8 @@ import theano ...@@ -11,6 +11,8 @@ import theano
from theano.tests import unittest_tools as utt from theano.tests import unittest_tools as utt
import theano.sandbox.cuda as cuda import theano.sandbox.cuda as cuda
from theano.sandbox.cuda import basic_ops
if cuda.cuda_available == False: if cuda.cuda_available == False:
raise SkipTest('Optional package cuda disabled') raise SkipTest('Optional package cuda disabled')
...@@ -330,6 +332,17 @@ class test_local_gpu_tensordot(unittest.TestCase): ...@@ -330,6 +332,17 @@ class test_local_gpu_tensordot(unittest.TestCase):
f3(tensor1, tensor3) f3(tensor1, tensor3)
import theano.tests.test_ifelse
class TestIfElse(theano.tests.test_ifelse.test_ifelse):
dtype = "float32"
mode = mode_with_gpu
cast_output = staticmethod(basic_ops.as_cuda_ndarray_variable)
def get_ifelse(self, n):
return theano.ifelse.IfElse(n, gpu=True, as_view=True)
if __name__ == '__main__': if __name__ == '__main__':
test_gpualloc() test_gpualloc()
test_opt_gpujoin_onlyajoin() test_opt_gpujoin_onlyajoin()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论