提交 216a6670 authored 作者: Frederic's avatar Frederic

tmp fix to the shapes error with cudnnpool

上级 987a15a5
......@@ -745,8 +745,8 @@ if (err%(name)s != CUDNN_STATUS_SUCCESS) {
# not connected to desc
return [[1], [0]]
def c_code_cache_version(self):
return (3,)
# def c_code_cache_version(self):
# return (3,)
class GpuDnnPoolGrad(DnnBase):
......
......@@ -57,8 +57,10 @@ def test_pooling():
x = T.ftensor4()
for func in (T.max, T.mean):
for ws in (4, 5):
for ws in (2, 4, 5):
for stride in (2, 3):
if stride > ws:
continue
out1 = cuda.dnn.dnn_pool(
x, ws=(ws, ws),
stride=(stride, stride),
......@@ -68,15 +70,16 @@ def test_pooling():
f1 = theano.function([x], out1, mode=mode_with_gpu)
f2 = theano.function([x], out2, mode=mode_with_gpu)
data = numpy.random.normal(
0, 1, (1, 10, 100, 100)).astype("float32")
a = f1(data).__array__()
b = f2(data).__array__()
assert numpy.allclose(a, b,
atol=numpy.finfo(numpy.float32).eps)
for shp in [(1, 10, 100, 100),
(1, 3, 99, 99),
(32, 1, 147, 197),
]:
data = numpy.random.normal(0, 1, shp).astype("float32")
a = f1(data).__array__()
b = f2(data).__array__()
assert numpy.allclose(a, b,
atol=numpy.finfo(numpy.float32).eps)
def test_pooling_opt():
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论