提交 14fd48fc authored 作者: Frederic Bastien's avatar Frederic Bastien

made test less verbose

上级 b9d5ad20
...@@ -186,6 +186,7 @@ def test_elemwise_collapse(): ...@@ -186,6 +186,7 @@ def test_elemwise_collapse():
v = numpy.asarray(numpy.random.rand(shape[0],1,*shape[1:]),dtype='float32') v = numpy.asarray(numpy.random.rand(shape[0],1,*shape[1:]),dtype='float32')
v=cuda_ndarray.CudaNdarray(v) v=cuda_ndarray.CudaNdarray(v)
if False:
for id,n in enumerate(f.maker.env.toposort()): for id,n in enumerate(f.maker.env.toposort()):
print id, n print id, n
#let debugmode catch errors #let debugmode catch errors
...@@ -208,6 +209,7 @@ def test_elemwise_collapse2(): ...@@ -208,6 +209,7 @@ def test_elemwise_collapse2():
v = numpy.asarray(numpy.random.rand(shape[0],5,*shape[1:]),dtype='float32') v = numpy.asarray(numpy.random.rand(shape[0],5,*shape[1:]),dtype='float32')
v=cuda_ndarray.CudaNdarray(v) v=cuda_ndarray.CudaNdarray(v)
if False:
for id,n in enumerate(f.maker.env.toposort()): for id,n in enumerate(f.maker.env.toposort()):
print id, n print id, n
#let debugmode catch errors #let debugmode catch errors
...@@ -230,6 +232,7 @@ def test_elemwise_collapse3(): ...@@ -230,6 +232,7 @@ def test_elemwise_collapse3():
v = numpy.asarray(numpy.random.rand(5,shape[0],shape[1],4),dtype='float32') v = numpy.asarray(numpy.random.rand(5,shape[0],shape[1],4),dtype='float32')
v=cuda_ndarray.CudaNdarray(v) v=cuda_ndarray.CudaNdarray(v)
if False:
for id,n in enumerate(f.maker.env.toposort()): for id,n in enumerate(f.maker.env.toposort()):
print id, n print id, n
#let debugmode catch errors #let debugmode catch errors
...@@ -252,6 +255,7 @@ def test_elemwise_collapse4(): ...@@ -252,6 +255,7 @@ def test_elemwise_collapse4():
v = numpy.asarray(numpy.random.rand(5,shape[0],shape[1],4),dtype='float32') v = numpy.asarray(numpy.random.rand(5,shape[0],shape[1],4),dtype='float32')
v=cuda_ndarray.CudaNdarray(v) v=cuda_ndarray.CudaNdarray(v)
if False:
for id,n in enumerate(f.maker.env.toposort()): for id,n in enumerate(f.maker.env.toposort()):
print id, n print id, n
#let debugmode catch errors #let debugmode catch errors
...@@ -259,7 +263,6 @@ def test_elemwise_collapse4(): ...@@ -259,7 +263,6 @@ def test_elemwise_collapse4():
assert numpy.allclose(out,a.reshape(1,shape[0],shape[1],1)+v+2) assert numpy.allclose(out,a.reshape(1,shape[0],shape[1],1)+v+2)
print "Expected collapse to 3 dimensions" print "Expected collapse to 3 dimensions"
def test_elemwise_collapse5(): def test_elemwise_collapse5():
""" Test when only one inputs have two broadcastable dimension at the beginning and we add a scalar""" """ Test when only one inputs have two broadcastable dimension at the beginning and we add a scalar"""
...@@ -275,6 +278,7 @@ def test_elemwise_collapse5(): ...@@ -275,6 +278,7 @@ def test_elemwise_collapse5():
v = numpy.asarray(numpy.random.rand(5,4,shape[0],shape[1]),dtype='float32') v = numpy.asarray(numpy.random.rand(5,4,shape[0],shape[1]),dtype='float32')
v=cuda_ndarray.CudaNdarray(v) v=cuda_ndarray.CudaNdarray(v)
if False:
for id,n in enumerate(f.maker.env.toposort()): for id,n in enumerate(f.maker.env.toposort()):
print id, n print id, n
#let debugmode catch errors #let debugmode catch errors
...@@ -295,6 +299,7 @@ def test_elemwise_collapse6(): ...@@ -295,6 +299,7 @@ def test_elemwise_collapse6():
v = numpy.asarray(numpy.random.rand(1,1,shape[0],shape[1]),dtype='float32') v = numpy.asarray(numpy.random.rand(1,1,shape[0],shape[1]),dtype='float32')
v=cuda_ndarray.CudaNdarray(v) v=cuda_ndarray.CudaNdarray(v)
if False:
for id,n in enumerate(f.maker.env.toposort()): for id,n in enumerate(f.maker.env.toposort()):
print id, n print id, n
#let debugmode catch errors #let debugmode catch errors
...@@ -313,7 +318,7 @@ def test_elemwise_collapse7(atol=1e-6): ...@@ -313,7 +318,7 @@ def test_elemwise_collapse7(atol=1e-6):
a3 = a2.dimshuffle(0, 'x', 1, 2) a3 = a2.dimshuffle(0, 'x', 1, 2)
f = pfunc([], [a3+2]) f = pfunc([], [a3+2])
if False:
for id,n in enumerate(f.maker.env.toposort()): for id,n in enumerate(f.maker.env.toposort()):
print id, n print id, n
#let debugmode catch errors #let debugmode catch errors
...@@ -321,5 +326,3 @@ def test_elemwise_collapse7(atol=1e-6): ...@@ -321,5 +326,3 @@ def test_elemwise_collapse7(atol=1e-6):
ans=(a+2).reshape(shape[0],1,shape[1],shape[2]) ans=(a+2).reshape(shape[0],1,shape[1],shape[2])
assert numpy.allclose(out,ans, atol=atol) assert numpy.allclose(out,ans, atol=atol)
print "Expected collapse to c contiguous" print "Expected collapse to c contiguous"
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论