提交 c0cca5ae authored 作者: Shawn Tan's avatar Shawn Tan

Fixed some mistakes with assert

上级 001938e4
...@@ -7599,12 +7599,11 @@ def test_alloc_diag(): ...@@ -7599,12 +7599,11 @@ def test_alloc_diag():
# Test infer_shape # Test infer_shape
f_shape = theano.function([x], adiag_op(x).shape) f_shape = theano.function([x], adiag_op(x).shape)
assert isinstance(topo[0].op, DeepCopyOp)
theano.printing.debugprint(f_shape.maker.fgraph.outputs[0]) theano.printing.debugprint(f_shape.maker.fgraph.outputs[0])
output_shape = f_shape(test_val) output_shape = f_shape(test_val)
assert any(isinstance(node.op, AllocDiag) assert not any(isinstance(node.op, AllocDiag)
for node in f_shape.maker.fgraph.toposort()]) for node in f_shape.maker.fgraph.toposort())
rediag_shape = np.diagonal( rediag_shape = np.diagonal(
np.ones(output_shape), np.ones(output_shape),
offset=offset, offset=offset,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论