提交 876507f6 authored 作者: ChienliMa's avatar ChienliMa

fgraph.inptus should be modified if we replace an inputs variable

上级 d71a80f6
......@@ -326,6 +326,7 @@ class T_function(unittest.TestCase):
assert map_SV[key.name].container.storage[0] ==\
cpy.fn.storage_map[key][0]
second_time = True
def test_copy_delete_updates(self):
......
......@@ -574,6 +574,10 @@ class FunctionGraph(utils.object2):
% (tval_shape, new_tval_shape),
r, new_r, str(reason))
# if inputs was replaced, change self.inputs
if r in self.inputs:
self.inputs[self.inputs.index(r)] = new_r
for node, i in list(r.clients): # copy the client list for iteration
assert (node == 'output' and self.outputs[i] is r) or (node.inputs[i] is r)
self.change_input(node, i, new_r, reason=reason)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论