Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/VainF/Torch-Pruning
Browse files Browse the repository at this point in the history
  • Loading branch information
VainF committed Dec 1, 2024
2 parents c9e7a5d + 5eb78da commit a1ee2d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion torch_pruning/pruner/algorithms/metapruner.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,8 +419,8 @@ def _prune(self) -> typing.Generator:
if group is None: continue
ch_groups = self._get_channel_groups(group)
imp = self.estimate_importance(group) # raw importance score
group_size = len(imp) // ch_groups
if imp is None: continue
group_size = len(imp) // ch_groups
if ch_groups > 1: # layers with dimension grouping, such as GroupConv, GroupNorm, Multi-head attention, etc.
# We average importance across groups here. For example:
# imp = [1, 2, 3, 4, 5, 6] with ch_groups=2.
Expand Down

0 comments on commit a1ee2d7

Please sign in to comment.