Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove early out in xnnpack pruning policy model traversal #1088

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
remove early out
If there are multiple input layers (and therefore paths),
this early out might return an empty set before all paths are checked.
By simply removing it, the path that doesn't have a next layer ends, nothing is added to the `found_layers` and the other paths continue to be checked.
  • Loading branch information
christian-steinmeyer authored Aug 18, 2023
commit b46b1e70c6dcf0c40bdd9ec909c4ca6907e2ce12
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,6 @@ def _lookup_layers(self, source_layers, stop_fn, next_fn):
found_layers.add(layer)
else:
next_layers = next_fn(layer)
if not next_layers:
return set()
for next_layer in next_layers:
if next_layer not in used_layers:
used_layers.add(next_layer)
Expand Down