提交 f5ec9504 authored 作者: Frederic Bastien's avatar Frederic Bastien

made the test compatible with the new way to allow easier debuging.

上级 a3c6fabf
...@@ -9,7 +9,8 @@ from theano import tensor ...@@ -9,7 +9,8 @@ from theano import tensor
from theano import compile, gof from theano import compile, gof
def test_state_propagation(): class T_test_module(unittest.TestCase):
def test_state_propagation(self):
x = tensor.vector() x = tensor.vector()
rk = RandomKit('rk', 1000) rk = RandomKit('rk', 1000)
f = compile.function([x, (rk, [gof.Container(r = gof.generic, storage = [123], name='bla')])], rk.binomial(tensor.shape(x)), mode='FAST_COMPILE') f = compile.function([x, (rk, [gof.Container(r = gof.generic, storage = [123], name='bla')])], rk.binomial(tensor.shape(x)), mode='FAST_COMPILE')
...@@ -21,7 +22,7 @@ def test_state_propagation(): ...@@ -21,7 +22,7 @@ def test_state_propagation():
for j in xrange(i+1, 5): for j in xrange(i+1, 5):
assert not N.all(rvals[i] == rvals[j]) assert not N.all(rvals[i] == rvals[j])
def test_B(): def test_B(self):
"""Test that random numbers change from call to call! """Test that random numbers change from call to call!
Also, make sure that the seeding strategy doesn't change without failing a test. Also, make sure that the seeding strategy doesn't change without failing a test.
...@@ -61,7 +62,6 @@ def test_B(): ...@@ -61,7 +62,6 @@ def test_B():
print s print s
assert s == rvals[i] assert s == rvals[i]
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() from theano.tests import main
main("test_raw_random")
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论