提交 e0bf7f14 authored 作者: Frederic Bastien's avatar Frederic Bastien

Fix and add an assert

上级 9ca8c709
...@@ -379,9 +379,11 @@ def local_0_dot_x(node): ...@@ -379,9 +379,11 @@ def local_0_dot_x(node):
return [T.alloc(constant_zero, y.shape[1])] return [T.alloc(constant_zero, y.shape[1])]
elif x.ndim == 2 and y.ndim == 1: elif x.ndim == 2 and y.ndim == 1:
constant_zero = assert_(constant_zero, constant_zero = assert_(constant_zero,
T.eq(x.shape[1], y.shape[1])) T.eq(x.shape[1], y.shape[0]))
return [T.alloc(constant_zero, x.shape[0])] return [T.alloc(constant_zero, x.shape[0])]
elif x.ndim == 1 and y.ndim == 1: elif x.ndim == 1 and y.ndim == 1:
constant_zero = assert_(constant_zero,
T.eq(x.shape[0], y.shape[0]))
return [constant_zero] return [constant_zero]
else: else:
_logger.warning("Optimization Warning: " _logger.warning("Optimization Warning: "
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论