提交 6efef55a authored 作者: Frederic Bastien's avatar Frederic Bastien

make the new opt work for in put of the graph and constant.

上级 1e481c32
...@@ -687,6 +687,10 @@ def local_alloc_elemwise(node): ...@@ -687,6 +687,10 @@ def local_alloc_elemwise(node):
no_broad_idx = -1 no_broad_idx = -1
for idx,i in enumerate(node.inputs): for idx,i in enumerate(node.inputs):
if not i.owner: if not i.owner:
if list(i.type.broadcastable) == [False,]*i.type.ndim:
no_broad_idx = idx
break
else:
continue continue
if not any(i.type.broadcastable) and not isinstance(i.owner.op, T.Alloc): if not any(i.type.broadcastable) and not isinstance(i.owner.op, T.Alloc):
no_broad_idx = idx no_broad_idx = idx
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论