1. Learn
  2. /
  3. Courses
  4. /
  5. Scalable AI Models with PyTorch Lightning

Connected

Exercise

Finalize pruning by removing the mask

After pruning a model, you need to finalize it before saving or deploying. This means removing the pruning mask so the model no longer tracks which weights were zeroed. You'll use prune.remove() to complete this step.

Instructions

100 XP
  • Finalize the pruning of the weight parameter.
  • Use prune.remove() to remove the mask and store the final weights.
  • Print the model to confirm pruning removal.