提交 3a4bdbbd authored 作者: Razvan Pascanu's avatar Razvan Pascanu

used until from scan_module

After talking to Pascal, I decided to leave until in scan_module and not to export it to theano.until. So I had to fix the tests as well for this.
上级 ca1700dc
...@@ -2275,7 +2275,7 @@ class T_Scan(unittest.TestCase): ...@@ -2275,7 +2275,7 @@ class T_Scan(unittest.TestCase):
def test_while0(self): def test_while0(self):
x = tensor.vector('x') x = tensor.vector('x')
def lambda_fn(x_t): def lambda_fn(x_t):
return x_t+1, theano.until( x_t > 3) return x_t+1, theano.scan_module.until( x_t > 3)
o, _ = theano.scan(lambda_fn, x) o, _ = theano.scan(lambda_fn, x)
f = theano.function([x], o) f = theano.function([x], o)
vx = numpy.zeros((50,)) vx = numpy.zeros((50,))
...@@ -2286,7 +2286,7 @@ class T_Scan(unittest.TestCase): ...@@ -2286,7 +2286,7 @@ class T_Scan(unittest.TestCase):
def test_while1(self): def test_while1(self):
x = tensor.vector('x') x = tensor.vector('x')
def lambda_fn(x_t): def lambda_fn(x_t):
return x_t+1, theano.until( x_t > 3) return x_t+1, theano.scan_module.until( x_t > 3)
o, _ = theano.scan(lambda_fn, x) o, _ = theano.scan(lambda_fn, x)
o2, _ = theano.scan(lambda x_t:x_t + 2, o2, _ = theano.scan(lambda x_t:x_t + 2,
x) x)
...@@ -2305,9 +2305,9 @@ class T_Scan(unittest.TestCase): ...@@ -2305,9 +2305,9 @@ class T_Scan(unittest.TestCase):
def test_while2(self): def test_while2(self):
x = tensor.vector('x') x = tensor.vector('x')
def lambda_fn(x_t): def lambda_fn(x_t):
return x_t+1, theano.until( x_t > 3) return x_t+1, theano.scan_module.until( x_t > 3)
o, _ = theano.scan(lambda_fn, x) o, _ = theano.scan(lambda_fn, x)
o2, _ = theano.scan(lambda x_t:( x_t + 2, theano.until(x_t>3)), o2, _ = theano.scan(lambda x_t:( x_t + 2, theano.scan_module.until(x_t>3)),
x) x)
f = theano.function([x], [o,o2]) f = theano.function([x], [o,o2])
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论