提交 8d8899b2 authored 作者: Frederic's avatar Frederic

a few other small crash fix just introduced

上级 b9e64527
......@@ -688,7 +688,7 @@ def _check_inputs(node, storage_map, r_vals, dr_vals, active_nodes,
var = node.outputs[oo]
out_var = storage_map[var][0]
in_var = storage_map[node.inputs[ii[0]]][0]
if var.may_share_memory(out_var, in_var):
if var.type.may_share_memory(out_var, in_var):
actually_inplace_outputs.append(node.outputs[oo])
if warn_input_not_reused and destroyed_res_list:
......@@ -706,7 +706,7 @@ def _check_inputs(node, storage_map, r_vals, dr_vals, active_nodes,
var = node.outputs[oo]
out_var = storage_map[var][0]
in_var = storage_map[node.inputs[ii[0]]][0]
may_share = var.may_share_memory(out_var, in_var)
may_share = var.type.may_share_memory(out_var, in_var)
if may_share:
actually_inplace_outputs.append(node.outputs[oo])
......@@ -769,7 +769,7 @@ def _check_viewmap(node, storage_map):
for ii, inode in enumerate(node.inputs):
if inode.may_share_memory(outstorage, storage_map[inode][0]):
if inode.type.may_share_memory(outstorage, storage_map[inode][0]):
nodeid = id(inode)
bad_alias[nodeid] = ii
......@@ -798,7 +798,8 @@ def _check_viewmap(node, storage_map):
# check to see if we share memory with this other output
# this is not a problem if the node is not actually used
if (_is_used_in_graph(other_onode) and
other_onode.may_share_memory(outstorage, other_storage)):
other_onode.type.may_share_memory(outstorage,
other_storage)):
raise BadViewMap(node, oi, outstorage,
out_alias_idx=other_oi)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论