提交 87d7a3bf authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Check for Elemwise add in a less fragile way.

上级 f5c7aa57
......@@ -56,7 +56,7 @@ from sys import maxsize
import numpy
import theano
from theano import tensor
from theano import tensor, scalar
from theano.tensor import opt, get_scalar_constant_value, Alloc, AllocEmpty
from theano import gof
from theano.compat import OrderedDict
......@@ -782,8 +782,7 @@ class PushOutScanOutput(gof.Optimizer):
break
elif (isinstance(nd.op, theano.tensor.elemwise.Elemwise) and
isinstance(nd.op.nfunc, numpy.ufunc) and
nd.op.nfunc.__name__ == 'add' and
nd.op.scalar_op == scalar.add and
nd.out in args.inner_out_sit_sot and
self.inner_sitsot_only_last_step_used(nd.out, args)):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论