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

Moved the gpu images2neibs to the cuda folder.

上级 28bfa8d5
差异被折叠。
# Skip test if cuda_ndarray is not available.
from nose.plugins.skip import SkipTest
import numpy
import theano
import theano.sandbox.cuda as cuda_ndarray
if cuda_ndarray.cuda_available == False:
raise SkipTest('Optional package cuda disabled')
import theano.sandbox.test_neighbours
from theano.sandbox.cuda.neighbours import GpuImages2Neibs
if theano.config.mode == 'FAST_COMPILE':
mode_with_gpu = theano.compile.mode.get_mode('FAST_RUN').including('gpu')
else:
mode_with_gpu = theano.compile.mode.get_default_mode().including('gpu')
class T_GpuImages2Neibs(theano.sandbox.test_neighbours.T_Images2Neibs):
def __init__(self, name):
self.mode = mode_with_gpu
self.op = GpuImages2Neibs
return super(T_GpuImages2Neibs, self).__init__(name)
if __name__ == '__main__':
unittest.main()
import numpy import numpy
import theano import theano
from theano import shared, function from theano import shared, function
import theano.tensor as T
from neighbours import (images2neibs, neibs2images,
Images2Neibs, GpuImages2Neibs)
# Skip test if cuda_ndarray is not available.
from nose.plugins.skip import SkipTest
import theano.sandbox.cuda as cuda
from theano.gof.python25 import any from theano.gof.python25 import any
import theano.tensor as T
from neighbours import images2neibs, neibs2images, Images2Neibs
from theano.tests import unittest_tools from theano.tests import unittest_tools
if theano.config.mode == 'FAST_COMPILE': if theano.config.mode == 'FAST_COMPILE':
mode_with_gpu = theano.compile.mode.get_mode('FAST_RUN').including('gpu')
mode_without_gpu = theano.compile.mode.get_mode( mode_without_gpu = theano.compile.mode.get_mode(
'FAST_RUN').excluding('gpu') 'FAST_RUN').excluding('gpu')
else: else:
mode_with_gpu = theano.compile.mode.get_default_mode().including('gpu')
mode_without_gpu = theano.compile.mode.get_default_mode().excluding('gpu') mode_without_gpu = theano.compile.mode.get_default_mode().excluding('gpu')
...@@ -347,14 +342,6 @@ class T_Images2Neibs(unittest_tools.InferShapeTester): ...@@ -347,14 +342,6 @@ class T_Images2Neibs(unittest_tools.InferShapeTester):
for i in range(1000): for i in range(1000):
f() f()
class T_GpuImages2Neibs(T_Images2Neibs):
def __init__(self, name):
self.mode = mode_with_gpu
self.op = GpuImages2Neibs
return super(T_GpuImages2Neibs, self).__init__(name)
if __name__ == '__main__': if __name__ == '__main__':
#test_neibs_gpu() unittest.main()
#test_neibs()
#test_neibs_grad_verify_grad()
test_neibs2images_crash_on_grad()
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论