提交 c9c8a418 authored 作者: Lijun Xue's avatar Lijun Xue

Fix ndim and remove ins error

上级 2278c315
...@@ -938,6 +938,7 @@ class VM_Linker(link.LocalLinker): ...@@ -938,6 +938,7 @@ class VM_Linker(link.LocalLinker):
viewed_by[var] = [] viewed_by[var] = []
view_of = {} view_of = {}
reallocated_info = {} reallocated_info = {}
dependencies = getattr(fgraph.profile, 'dependencies', {})
for idx in range(len(order)): for idx in range(len(order)):
node = order[idx] node = order[idx]
...@@ -968,7 +969,9 @@ class VM_Linker(link.LocalLinker): ...@@ -968,7 +969,9 @@ class VM_Linker(link.LocalLinker):
for ins in node.inputs: for ins in node.inputs:
assert not (ins in view_of and viewed_by[ins]) assert not (ins in view_of and viewed_by[ins])
if (ins.ndim == 0 and not storage_map[ins][0] and ins not in fgraph.outputs and ins.owner): if (getattr(ins, 'ndim', None) == 0 and not storage_map[ins][0]
and ins not in fgraph.outputs and ins.owner
and dependencies.get(ins, None)):
# Constant Memory cannot be changed, Constant storage_map # Constant Memory cannot be changed, Constant storage_map
# has a value here # has a value here
reuse_outs = [] reuse_outs = []
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论