提交 77b65acd authored 作者: Frederic Bastien's avatar Frederic Bastien 提交者: Frederic

Make the gpu version of DownsampleFactorMax and its grad don't crash on bigger inputs

上级 de522246
......@@ -269,6 +269,8 @@ def test_downsample():
(1, 1, 10, 1023),
(1, 1, 1025, 10),
(1, 1, 1023, 10),
(65536, 1, 10, 10),
(1, 65536, 10, 10),
]
numpy.random.RandomState(unittest_tools.fetch_seed()).shuffle(shps)
......@@ -299,6 +301,14 @@ def test_downsample():
for node in f2.maker.env.toposort()])
assert numpy.allclose(f(), f2())
# The grad is too slow on GT220 GPU
# This cause the computer to freeze...
# Remove this when it get optimized enought
# This only bypass the last 2 checks
# Those tests where passing in all Mode on a GTX470
if shp[0] > 30000 or shp[1] > 30000:
continue
g = pfunc(
[],
tensor.grad(ds_op(tensor.as_tensor_variable(a)).sum(),
......@@ -314,7 +324,7 @@ def test_downsample():
for node in g.maker.env.toposort()])
assert any([isinstance(node.op, DownsampleFactorMaxGrad)
for node in g2.maker.env.toposort()])
assert numpy.allclose(g(), g2())
assert numpy.allclose(g(), g2()), shp
# We already check that the gpu version return
# the same value as the gpu version for
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论