提交 82f53497 authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Add more tests for Ger.

上级 ab47e121
from unittest import TestCase from unittest import TestCase
from nose.plugins.skip import SkipTest
import theano import theano
from theano import tensor from theano import tensor
...@@ -48,17 +49,29 @@ GpuGemmTester = makeTester('GpuGemmTester', ...@@ -48,17 +49,29 @@ GpuGemmTester = makeTester('GpuGemmTester',
) )
) )
GpuGerTester = makeTester( class TestGpuSger(TestGer):
'GpuGerTester', def setUp(self):
op=ger_destructive, gpu_op=gpuger_inplace, self.mode = mode_with_gpu
cases=dict( dtype = self.dtype = 'float32' # optimization isn't dtype-dependent
test1=[rand(4, 5), 1.0, rand(4), rand(5)], self.A = tensor.tensor(dtype=dtype, broadcastable=(False, False))
test2=[rand(4, 5), 0.6, rand(4), rand(5)], self.a = tensor.tensor(dtype=dtype, broadcastable=())
test3=[rand(4, 5), -1.0, rand(4), rand(5)], self.x = tensor.tensor(dtype=dtype, broadcastable=(False,))
test4=[rand(4, 5), -0.6, rand(4), rand(5)], self.y = tensor.tensor(dtype=dtype, broadcastable=(False,))
test5=[rand(4, 5), 0.0, rand(4), rand(5)], self.ger_destructive = gpuger_inplace
)
) # data on the gpu make the op always inplace
self.ger = gpuger_inplace
self.gemm = gpugemm_inplace
def test_f32_0_0(self):
raise SkipTest('0-sized objects not supported')
def test_f32_1_0(self):
raise SkipTest('0-sized objects not supported')
def test_f32_0_1(self):
raise SkipTest('0-sized objects not supported')
class TestGpuSgerNoTransfer(TestGpuSger):
shared = staticmethod(gpuarray_shared_constructor)
class TestGpuGer_OpContract(TestCase, unittest_tools.T_OpContractMixin): class TestGpuGer_OpContract(TestCase, unittest_tools.T_OpContractMixin):
def setUp(self): def setUp(self):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论