提交 dfe04f9a authored 作者: Samira Shabanian's avatar Samira Shabanian

added mode=theano.compile.get_default_mode().including(local_expm1) for all the functions

上级 9baf74f6
...@@ -6131,14 +6131,14 @@ def test_local_expm1(): ...@@ -6131,14 +6131,14 @@ def test_local_expm1():
z = T.exp(x) - 2. z = T.exp(x) - 2.
t = T.exp(x) - x t = T.exp(x) - x
s = T.exp(u) - numpy.ones((4, 3)).astype(config.floatX) s = T.exp(u) - numpy.ones((4, 3)).astype(config.floatX)
MODE = theano.compile.get_default_mode().including('local_expm1')
f = function([x], y) f = function([x], y, mode=MODE)
g = function([x], z) g = function([x], z, mode=MODE)
h = function([x], t) h = function([x], t, mode=MODE)
r = function([u], s) r = function([u], s, mode=MODE)
x_val = numpy.random.rand(4, 3).astype(config.floatX) x_val = numpy.random.rand(4, 3).astype(config.floatX)
f_val = f(x_val) f_val = f(x_val)
f_test = function([x], T.expm1(x), mode=theano.compile.get_default_mode().including('local_expm1')) f_test = function([x], T.expm1(x), mode=MODE)
assert numpy.allclose(f_val, f_test(x_val)) assert numpy.allclose(f_val, f_test(x_val))
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论