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

make inplace optimizer of Elemewise a little faster.

上级 befed699
......@@ -119,6 +119,10 @@ def insert_inplace_optimizer(env):
and not env.destroyers(node.inputs[i])]
for candidate_output in candidate_outputs:
for candidate_input in candidate_inputs:
#remove inputs that don't have the same dtype as the output.
if node.inputs[candidate_input].type!=node.outputs[candidate_output].type:
continue
inplace_pattern = dict(baseline, **{candidate_output: candidate_input})
try:
new = Elemwise(
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论