提交 8c3b228f authored 作者: Frederic Bastien's avatar Frederic Bastien

Fix test in FAST_COMPILE.

上级 361317ad
...@@ -327,9 +327,13 @@ def test_batch_normalization_train_broadcast(): ...@@ -327,9 +327,13 @@ def test_batch_normalization_train_broadcast():
# the paired ops are exactly the same, so the optimizer should have # the paired ops are exactly the same, so the optimizer should have
# collapsed the sum of differences to a constant zero # collapsed the sum of differences to a constant zero
nodes = f.maker.fgraph.toposort() nodes = f.maker.fgraph.toposort()
if theano.config.mode != "FAST_COMPILE":
assert len(nodes) == 1 assert len(nodes) == 1
assert isinstance(nodes[0].op, theano.compile.DeepCopyOp) assert isinstance(nodes[0].op, theano.compile.DeepCopyOp)
assert 0.0 == theano.tensor.get_scalar_constant_value(nodes[0].inputs[0]) inputs = [numpy.asarray(numpy.random.rand(*((4,)*n)), x.dtype)
for n in [x.ndim, scale.ndim, bias.ndim,
running_mean.ndim, running_var.ndim]]
assert 0.0 == f(*inputs)
def test_batch_normalization_test(): def test_batch_normalization_test():
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论