提交 4bbddc1c authored 作者: Frederic Bastien's avatar Frederic Bastien

bugfix. If you used Value, TensorValue, tensor.value(), the value was not…

bugfix. If you used Value, TensorValue, tensor.value(), the value was not considered as an input. So this was making the inplace_opt optimizer optimize it while it should not be doing it.
上级 113211ed
...@@ -395,10 +395,13 @@ class Method(Component): ...@@ -395,10 +395,13 @@ class Method(Component):
for input in gof.graph.inputs((list(outputs) if isinstance(outputs, (list, tuple)) else [outputs]) for input in gof.graph.inputs((list(outputs) if isinstance(outputs, (list, tuple)) else [outputs])
+ [x.update for x in inputs if getattr(x, 'update', False)], + [x.update for x in inputs if getattr(x, 'update', False)],
blockers = _inputs): blockers = _inputs):
if input not in _inputs and not isinstance(input, gof.Value): if input not in _inputs:
# Add this input to the inputs; we require that storage already exists for them, # Add this input to the inputs; we require that storage already exists for them,
# but otherwise they are immutable. # but otherwise they are immutable.
storage = get_storage(input, not allocate_all) if isinstance(input, gof.Value):
storage = get_storage(input)
else:
storage = get_storage(input, not allocate_all)
inputs.append(storage) inputs.append(storage)
return F.function(inputs, outputs, mode) return F.function(inputs, outputs, mode)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论