提交 9fd94925 authored 作者: Frederic Bastien's avatar Frederic Bastien

don't put inplace op at graph construction time. They will be removed and reinserted later.

上级 3f1889b1
......@@ -323,7 +323,10 @@ class DimShuffle(Op):
for i, v in enumerate(self.new_order):
if v != 'x':
grad_order[v] = i
return [DimShuffle(gz.type.broadcastable, grad_order, inplace=True)(Elemwise(scalar.identity)(gz))]
# Do not make the DimShuffle inplace as an optimization at the
# canonicalization optimization phase will remove the implace.
# The inplace will be reintroduced automatically later in the graph.
return [DimShuffle(gz.type.broadcastable, grad_order)(Elemwise(scalar.identity)(gz))]
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论