提交 574174c4 authored 作者: Brandon T. Willard's avatar Brandon T. Willard 提交者: Brandon T. Willard

Make a copy of the outputs argument in FunctionGraph

上级 776518b7
......@@ -137,8 +137,7 @@ class FunctionGraph(utils.MetaObject):
# outputs even if they aren't used in the graph.
self.variables = set()
# TODO FIXME: We should *not* be using a list created elsewhere!
self.outputs = outputs
self.outputs = list(outputs)
self.clients = {}
for f in features:
......
......@@ -821,7 +821,7 @@ def is_same_graph_with_merge(var1, var2, givens=None):
# which happens when the graph is made of a single Variable.
# We also need to make sure we replace a Variable if it is present in
# `givens`.
vars_replaced = [givens.get(v, v) for v in vars]
vars_replaced = [givens.get(v, v) for v in fgraph.outputs]
o1, o2 = [v.owner for v in vars_replaced]
if o1 is None and o2 is None:
# Comparing two single-Variable graphs: they are equal if they are
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论