提交 5a730afe authored 作者: Gijs van Tulder's avatar Gijs van Tulder

Implement assert_shape without tensor.all.

上级 65d17342
......@@ -501,7 +501,7 @@ def assert_shape(x, expected_shape, msg='Unexpected shape.'):
if expected_shape[i] is not None:
tests.append(theano.tensor.eq(shape[i], expected_shape[i]))
if tests:
return Assert(msg)(x, theano.tensor.all(tests))
return Assert(msg)(x, *tests)
else:
return x
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论