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

Fix gpuarray test

上级 56f1c0dd
...@@ -27,6 +27,8 @@ from .test_basic_ops import (mode_with_gpu, ...@@ -27,6 +27,8 @@ from .test_basic_ops import (mode_with_gpu,
mode_without_gpu) mode_without_gpu)
from ..type import GpuArrayType from ..type import GpuArrayType
from ..conv import GpuConv from ..conv import GpuConv
from theano.sandbox.gpuarray import dnn
import pygpu import pygpu
gftensor4 = GpuArrayType('float32', [False] * 4) gftensor4 = GpuArrayType('float32', [False] * 4)
...@@ -501,6 +503,9 @@ def test_subsample(): ...@@ -501,6 +503,9 @@ def test_subsample():
class TestConv2DGPU(unittest.TestCase): class TestConv2DGPU(unittest.TestCase):
conv_ops = (GpuConv,
dnn.DnnBase)
def test_logical_shapes(self): def test_logical_shapes(self):
seed_rng() seed_rng()
for stride in range(1, 4): for stride in range(1, 4):
...@@ -527,7 +532,7 @@ class TestConv2DGPU(unittest.TestCase): ...@@ -527,7 +532,7 @@ class TestConv2DGPU(unittest.TestCase):
func = theano.function([a, A], image_estimate, mode=mode_with_gpu) func = theano.function([a, A], image_estimate, mode=mode_with_gpu)
# theano.printing.debugprint(func,) # theano.printing.debugprint(func,)
assert any([isinstance(node.op, GpuConv) assert any([isinstance(node.op, self.conv_ops)
for node in func.maker.fgraph.toposort()]) for node in func.maker.fgraph.toposort()])
a_in = numpy.random.randn(*featshp).astype("float32") a_in = numpy.random.randn(*featshp).astype("float32")
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论