Skip to content
This repository was archived by the owner on Jun 3, 2025. It is now read-only.

Commit 512f8b5

Browse files
committed
fix None type propagation issue when ConstantPruningModifier start_epoch > 0 (#885)
1 parent 42d282e commit 512f8b5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/sparseml/pytorch/sparsification/pruning/mask_params.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,8 @@ def update_param_masks(self, target: Union[float, List[float]]) -> List[Tensor]:
357357
target = [target] * len(self._params)
358358
if self.adjust_target_sparsity_for_thinning:
359359
for idx, sparsity_val in enumerate(target):
360+
if sparsity_val is None:
361+
continue # ie constant pruning
360362
applied_thinning = self._params_applied_thinning[idx]
361363
if applied_thinning > 0.0:
362364
# adjust sparsity for thinned (compressed) layer param

0 commit comments

Comments
 (0)