class_docstr: Parameters
  ----------
  model : pytorch model
      The model to be pruned
  config_list : list
      Supported keys:
          - prune_iterations : The number of rounds for the iterative pruning.
          - sparsity : The final sparsity when the compression is done.
  optimizer : pytorch optimizer
      The optimizer for the model
  lr_scheduler : pytorch lr scheduler
      The lr scheduler for the model if used
  reset_weights : bool
      Whether reset weights and optimizer at the beginning of each round.
class_docstr_tok: ["Parameters","--","--","--","--","--","model",":","pytorch","model","The","model","to","be","pruned","config_list",":","list","Supported","keys",":","-","prune_iterations",":","The","number","of","rounds","for","the","iterative","pruning",".","-","sparsity",":","The","final","sparsity","when","the","compression","is","done",".","optimizer",":","pytorch","optimizer","The","optimizer","for","the","model","lr_scheduler",":","pytorch","lr","scheduler","The","lr","scheduler","for","the","model","if","used","reset_weights",":","bool","Whether","reset","weights","and","optimizer","at","the","beginning","of","each","round","."]
code: def _calc_mask(self, wrapper, sparsity):
      weight = wrapper.module.weight.data
      if self.curr_prune_iteration == 0:
          mask = {
              "weight_mask": torch.ones(weight.shape).type_as(weight)
          }
      else:
          curr_sparsity = self._calc_sparsity(sparsity)
          mask = self.masker.calc_mask(
              sparsity=curr_sparsity, wrapper=wrapper
          )
      return mask
  
file_path: auptimizer/src/aup/compression/torch/pruning/lottery_ticket.py
imports: import copy
  import logging
  import torch
  from schema import And, Optional
  from ..utils.config_validation import CompressorSchema
  from ..compressor import Pruner
  from .finegrained_pruning import LevelPrunerMasker
label_desc: Use image node_id 4 for calling the LotteryTicketPruner obj's underlying member method code with example usage: obj._calc_mask(wrapper, sparsity) and returns: mask