提交 80d4a07e authored 作者: Vincent Dumoulin's avatar Vincent Dumoulin

Add GPU test

上级 8d9e0253
......@@ -252,3 +252,12 @@ class TestDnnConvTypes(test_abstract_conv.TestConvTypes):
self.constant_tensor = gpuarray.array(
numpy.zeros((3, 5, 7, 11), dtype='float32'),
context=get_context(test_ctx_name))
class TestConv2dTranspose(test_abstract_conv.TestConv2dTranspose):
mode = mode_with_gpu
def test_interface(self):
if not dnn_available(test_ctx_name):
raise SkipTest(dnn_available.msg)
super(self, TestConv2dTranspose).test_interface()
......@@ -1552,6 +1552,8 @@ class TestBilinearUpsampling(unittest.TestCase):
class TestConv2dTranspose(unittest.TestCase):
mode = None
def test_interface(self):
"""Test conv2d_transpose wrapper.
......@@ -1565,7 +1567,8 @@ class TestConv2dTranspose(unittest.TestCase):
outputs=conv2d_transpose(input=tensor.ones((2, 2, 4, 4)),
filters=tensor.ones((2, 1, 4, 4)),
output_shape=(2, 1, 10, 10),
input_dilation=(2, 2)))()
input_dilation=(2, 2)),
mode=self.mode)()
expected_output = numpy.array(
[[[[2, 2, 4, 4, 4, 4, 4, 4, 2, 2],
[2, 2, 4, 4, 4, 4, 4, 4, 2, 2],
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论