提交 48bfaf25 authored 作者: Frederic's avatar Frederic

fix new tests in FAST_COMPILE and pep8 fix it.

上级 1dd5f5fc
...@@ -134,13 +134,13 @@ class test_dimshuffle_lift(unittest.TestCase): ...@@ -134,13 +134,13 @@ class test_dimshuffle_lift(unittest.TestCase):
def test_stabilize_log_softmax(): def test_stabilize_log_softmax():
mode = theano.compile.mode.get_default_mode() mode = theano.compile.mode.get_default_mode()
mode = mode.including('local_log_softmax') mode = mode.including('local_log_softmax', 'specialize')
x = matrix() x = matrix()
y = theano.tensor.nnet.softmax(x) y = theano.tensor.nnet.softmax(x)
z = theano.tensor.log(y) z = theano.tensor.log(y)
f = function([x],z) f = function([x], z, mode=mode)
#check that the softmax has been optimized out #check that the softmax has been optimized out
for node in f.maker.fgraph.toposort(): for node in f.maker.fgraph.toposort():
...@@ -148,8 +148,9 @@ def test_stabilize_log_softmax(): ...@@ -148,8 +148,9 @@ def test_stabilize_log_softmax():
#call the function so debug mode can verify the optimized #call the function so debug mode can verify the optimized
#version matches the unoptimized version #version matches the unoptimized version
rng = numpy.random.RandomState([2012,8,22]) rng = numpy.random.RandomState([2012, 8, 22])
f(numpy.cast[config.floatX](rng.randn(2,3))) f(numpy.cast[config.floatX](rng.randn(2, 3)))
def test_add_canonizer_problem0(): def test_add_canonizer_problem0():
n_segments = 10 n_segments = 10
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论