提交 9835fbdb authored 作者: Frederic Bastien's avatar Frederic Bastien

Make an opt don't add useless node that futur opt would remove.

上级 4752037c
...@@ -3251,6 +3251,9 @@ def local_IncSubtensor_serialize(node): ...@@ -3251,6 +3251,9 @@ def local_IncSubtensor_serialize(node):
if movable_inputs: if movable_inputs:
new_inputs = ([i for i in node.inputs if not movable(i)] + new_inputs = ([i for i in node.inputs if not movable(i)] +
[mi.owner.inputs[0] for mi in movable_inputs]) [mi.owner.inputs[0] for mi in movable_inputs])
if len(new_inputs) == 0:
new_add = new_inputs[0]
else:
new_add = T.add(*new_inputs) new_add = T.add(*new_inputs)
# Copy over stacktrace from original output, as an error # Copy over stacktrace from original output, as an error
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论