Skip to content

Commit

Permalink
Fix error reported by '[theano-dev] Recent Theano changes break my Op…
Browse files Browse the repository at this point in the history
… with multiple outputs'
  • Loading branch information
nouiz committed Sep 15, 2016
1 parent bd7bfba commit 1cd76f0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion theano/gof/opt.py
Original file line number Diff line number Diff line change
Expand Up @@ -1314,7 +1314,6 @@ def transform(self, node):
if not new_repl:
continue
else:
assert len(new_repl) == 1
if self.profile:
self.node_created[opt] += len(graph.ops(fgraph.variables, new_repl))
self.applied_true[opt] += 1
Expand All @@ -1324,6 +1323,9 @@ def transform(self, node):
# only 1 iteration or we are at the start of the graph.
if not self.apply_all_opts or not new_repl[0].owner:
return new_repl
if len(new_repl) > 1:
s = set([v.owner for v in new_repl])
assert len(s) == 1
repl = new_repl
node = repl[0].owner

Expand Down

0 comments on commit 1cd76f0

Please sign in to comment.