提交 bd7ef367 authored 作者: James Bergstra's avatar James Bergstra

commented out test_maxpool. bring it back later after reviewing

上级 6a2639ad
...@@ -47,23 +47,28 @@ def test_gemm(): ...@@ -47,23 +47,28 @@ def test_gemm():
assert numpy.allclose(numpy.dot(a0, bval)+numpy.exp(cval), a.value) assert numpy.allclose(numpy.dot(a0, bval)+numpy.exp(cval), a.value)
def test_maxpool(): if 0:
"""TODO: test the gpu version!!! """ # This is commented out because it doesn't make sense...
for d0, d1, r_true, r_false in [(4,4,[[[[5,7],[13,15]]]],[[[[5,7],[13,15]]]]), # tcn.blas has no op called DownsampleFactorMax
(5,5,[[[[6, 8],[ 16, 18], [ 21, 23]]]], # tcn.blas has an op called GpuDownsampleFactorMax, but that op requires arguments that are
[[[[6, 8, 9],[ 16, 18, 19], [ 21, 23, 24]]]])]: # CudaNdarrayType variables... so rethink this test?
for border,ret in [(True,r_true),(False, r_false)]: def test_maxpool():
ret=numpy.array(ret) """TODO: test the gpu version!!! """
a = tcn.blas.DownsampleFactorMax((2,2),border) for d0, d1, r_true, r_false in [(4,4,[[[[5,7],[13,15]]]],[[[[5,7],[13,15]]]]),
dmatrix4 = tensor.TensorType("float32", (False, False, False, False)) (5,5,[[[[6, 8],[ 16, 18], [ 21, 23]]]],
b = dmatrix4() [[[[6, 8, 9],[ 16, 18, 19], [ 21, 23, 24]]]])]:
f = pfunc([b], [a(b)]) for border,ret in [(True,r_true),(False, r_false)]:
ret=numpy.array(ret)
bval = numpy.arange(0,d0*d1).reshape(1,1,d0,d1) a = tcn.blas.DownsampleFactorMax((2,2),border)
r = f(bval)[0] dmatrix4 = tensor.TensorType("float32", (False, False, False, False))
# print bval, bval.shape, border b = dmatrix4()
print r, r.shape f = pfunc([b], [a(b)])
assert (ret==r).all()
bval = numpy.arange(0,d0*d1).reshape(1,1,d0,d1)
r = f(bval)[0]
# print bval, bval.shape, border
print r, r.shape
assert (ret==r).all()
def test_downsample(): def test_downsample():
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论