提交 a07899c8 authored 作者: Ziye Fan's avatar Ziye Fan

check if the model is a useless fill

上级 ee07a356
...@@ -1372,7 +1372,8 @@ def local_fill_sink(node): ...@@ -1372,7 +1372,8 @@ def local_fill_sink(node):
return False return False
c = node.op(*inputs) c = node.op(*inputs)
for model in models: for model in models:
c = T.fill(model, c) if model.type != c.type:
c = T.fill(model, c)
# The newly created node c doesn't has 'clients', # The newly created node c doesn't has 'clients',
# so this iteration is took place with node.outputs[0] # so this iteration is took place with node.outputs[0]
...@@ -3623,12 +3624,11 @@ register_canonicalize(local_fill_cut) ...@@ -3623,12 +3624,11 @@ register_canonicalize(local_fill_cut)
register_canonicalize(gof.OpRemove(T.tensor_copy), name='remove_tensor_copy') register_canonicalize(gof.OpRemove(T.tensor_copy), name='remove_tensor_copy')
################ ################
# Canonization # # Canonization #
################ ################
class Canonizer(gof.LocalOptimizer): class Canonizer(gof.LocalOptimizer):
""" """
Simplification tool. Simplification tool.
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论