class_docstr: Implementation of Weight Threshold Pruning for PyTorch models.
      Prunes weights with magnitudes lesser than the specified threshold.
  
  :param model: Model that needs to be pruned
  :type model: torch.nn.Module
  :param train_loader: Dataloader for training
  :type train_loader: torch.utils.data.DataLoader
  :param test_loader: Dataloader for validation/testing
  :type test_loader: torch.utils.data.DataLoader
  :param loss_fn: Loss function to be used for training
  :type loss_fn: torch.nn.Module
  :param device: Device used for implementation ("cpu" by default)
  :type device: torch.device
docstr: Function used for pruning
  
  :param threshold: Weight threshold. Weights with magnitudes lesser than the threshold are pruned.
      :type threshold: float
docstr_tok: ["Function","used","for","pruning",":","param","threshold",":","Weight","threshold",".","Weights","with","magnitudes","lesser","than","the","threshold","are","pruned",".",":","type","threshold",":","float"]
code: def prune_model(self, threshold):
      """
      Function used for pruning
  
      :param threshold: Weight threshold. Weights with magnitudes lesser than the threshold are pruned.
          :type threshold: float
      """
  
      for name, param in self.model.named_parameters():
          if "weight" in name:
              param_mask = torch.abs(param) < threshold
              param.data[param_mask] = 0.0
  
imports: import torch
  import torch.nn
  from ..common import BaseIterativePruner
label_desc: Use image node_id 2 for calling the WeightThresholdPruner obj's underlying member method code with example usage: obj.prune_model(threshold) without return types