提交 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():
z = T.exp(x) - 2.
t = T.exp(x) - x
s = T.exp(u) - numpy.ones((4, 3)).astype(config.floatX)
f = function([x], y)
g = function([x], z)
h = function([x], t)
r = function([u], s)
MODE = theano.compile.get_default_mode().including('local_expm1')
f = function([x], y, mode=MODE)
g = function([x], z, mode=MODE)
h = function([x], t, mode=MODE)
r = function([u], s, mode=MODE)
x_val = numpy.random.rand(4, 3).astype(config.floatX)
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))
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论