Skip to content

Commit a1ee2d7

Browse files
committed
Merge branch 'master' of https://github.com/VainF/Torch-Pruning
2 parents c9e7a5d + 5eb78da commit a1ee2d7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torch_pruning/pruner/algorithms/metapruner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,8 +419,8 @@ def _prune(self) -> typing.Generator:
419419
if group is None: continue
420420
ch_groups = self._get_channel_groups(group)
421421
imp = self.estimate_importance(group) # raw importance score
422-
group_size = len(imp) // ch_groups
423422
if imp is None: continue
423+
group_size = len(imp) // ch_groups
424424
if ch_groups > 1: # layers with dimension grouping, such as GroupConv, GroupNorm, Multi-head attention, etc.
425425
# We average importance across groups here. For example:
426426
# imp = [1, 2, 3, 4, 5, 6] with ch_groups=2.

0 commit comments

Comments
 (0)