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

added comments and fixed code not used...

上级 c26605d5
...@@ -510,8 +510,13 @@ def local_fill_to_alloc(node): ...@@ -510,8 +510,13 @@ def local_fill_to_alloc(node):
@register_specialize @register_specialize
@register_canonicalize @register_canonicalize
@gof.local_optimizer([T._shape]) @gof.local_optimizer([T.alloc])
def local_useless_alloc(node): def local_useless_alloc(node):
"""
if the input type is the same as the output type(dtype and broadcast)
their is no change in the shape of the input. So this is just a simple copy
of the input. This is not needed.
"""
if node.op == T.alloc: if node.op == T.alloc:
if node.inputs[0].type == node.outputs[0].type: if node.inputs[0].type == node.outputs[0].type:
return [node.inputs[0]] return [node.inputs[0]]
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论