Skip to content

Commit

Permalink
Skip empty group while pruning. (PaddlePaddle#236)
Browse files Browse the repository at this point in the history
  • Loading branch information
wanghaoshuang authored Apr 23, 2020
1 parent f3fcd83 commit ac10acf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions paddleslim/prune/pruner.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ def prune(self,
pruned_params = []
for param, ratio in zip(params, ratios):
group = collect_convs([param], graph, visited)[0] # [(name, axis)]
if group is None or len(group) == 0:
continue
if only_graph and self.idx_selector.__name__ == "default_idx_selector":

param_v = graph.var(param)
Expand Down

0 comments on commit ac10acf

Please sign in to comment.