Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ReyhaneAskari committed Jun 5, 2017
1 parent 6090615 commit ca96223
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions theano/gof/destroyhandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,8 @@ def get_destroyers_of(r):
def has_destroyers(protected_list):
visited_app_set = set()

def recursive_destroys_finder(clients_list):
for (app, idx) in clients_list:
def recursive_destroys_finder(protected_var):
for (app, idx) in protected_var.clients:
if app in visited_app_set:
continue
else:
Expand All @@ -409,12 +409,12 @@ def recursive_destroys_finder(clients_list):
if idx in [dmap for sublist in destroy_maps for dmap in sublist]:
return True
for var in getattr(app.op, 'view_map', {}).keys():
if recursive_destroys_finder(app.outputs[var].clients):
return True
if idx in app.op.view_map[var] and recursive_destroys_finder(app.outputs[var]):
return True
return False

for protected_var in protected_list:
if recursive_destroys_finder(protected_var.clients):
if recursive_destroys_finder(protected_var):
return True

fgraph.has_destroyers = has_destroyers
Expand Down

0 comments on commit ca96223

Please sign in to comment.