提交 baddb1d6 authored 作者: AdeB's avatar AdeB 提交者: Pascal Lamblin

Removes duplicate of scalar_op check

上级 dfe32419
...@@ -364,15 +364,16 @@ class T_softplus_opts(unittest.TestCase): ...@@ -364,15 +364,16 @@ class T_softplus_opts(unittest.TestCase):
out = T.log(sigmoid(x)) out = T.log(sigmoid(x))
f = theano.function([x], out, mode=self.m) f = theano.function([x], out, mode=self.m)
types_to_check = (theano.scalar.Neg,
theano.tensor.nnet.sigm.ScalarSoftplus,
theano.scalar.Neg)
assert check_stack_trace(f, ops_to_check=types_to_check) assert check_stack_trace(
f, ops_to_check=(theano.scalar.Neg,
theano.tensor.nnet.sigm.ScalarSoftplus))
topo = f.maker.fgraph.toposort() topo = f.maker.fgraph.toposort()
assert len(topo) == 3 assert len(topo) == 3
for i, op in enumerate(types_to_check): assert isinstance(topo[0].op.scalar_op, theano.scalar.Neg)
assert isinstance(topo[i].op.scalar_op, op) assert isinstance(topo[1].op.scalar_op,
theano.tensor.nnet.sigm.ScalarSoftplus)
assert isinstance(topo[2].op.scalar_op, theano.scalar.Neg)
f(numpy.random.rand(54).astype(config.floatX)) f(numpy.random.rand(54).astype(config.floatX))
def test_log1msigm_to_softplus(self): def test_log1msigm_to_softplus(self):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论