提交 1cd76f0f authored 作者: Frederic Bastien's avatar Frederic Bastien

Fix error reported by '[theano-dev] Recent Theano changes break my Op with multiple outputs'

上级 bd7bfba9
...@@ -1314,7 +1314,6 @@ class LocalOptGroup(LocalOptimizer): ...@@ -1314,7 +1314,6 @@ class LocalOptGroup(LocalOptimizer):
if not new_repl: if not new_repl:
continue continue
else: else:
assert len(new_repl) == 1
if self.profile: if self.profile:
self.node_created[opt] += len(graph.ops(fgraph.variables, new_repl)) self.node_created[opt] += len(graph.ops(fgraph.variables, new_repl))
self.applied_true[opt] += 1 self.applied_true[opt] += 1
...@@ -1324,6 +1323,9 @@ class LocalOptGroup(LocalOptimizer): ...@@ -1324,6 +1323,9 @@ class LocalOptGroup(LocalOptimizer):
# only 1 iteration or we are at the start of the graph. # only 1 iteration or we are at the start of the graph.
if not self.apply_all_opts or not new_repl[0].owner: if not self.apply_all_opts or not new_repl[0].owner:
return new_repl return new_repl
if len(new_repl) > 1:
s = set([v.owner for v in new_repl])
assert len(s) == 1
repl = new_repl repl = new_repl
node = repl[0].owner node = repl[0].owner
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论