class_docstr: Extension of PyTorch's native pruning infra for seamless
  model export and progressive sparsity schedules
  
  This class works by registering itself as a forward pre-hook
  into each prune-able `nn.Module` to apply the pruning mask
code: def apply_mask(self, module: _torch.nn.Module) -> _torch.Tensor:
      return self._apply_mask_impl(module)
  
imports: import logging
  import types
  from typing import Any
  from typing import Dict
  from typing import NamedTuple
  from typing import Optional
  from typing import cast
  import numpy
  import torch
  import torch.nn.utils.prune
  import torch.utils.hooks
  from coremltools.optimize.torch._typing import ParamsDict
  from coremltools.optimize.torch._utils.state_dict_utils import LoadStateDictPostHook
  from coremltools.optimize.torch.pruning._utils import block2_sparsity
  from coremltools.optimize.torch.pruning._utils import structured_sparsity
  from coremltools.optimize.torch.pruning._utils import unstructured_sparsity
label_desc: Use image node_id 7 for calling the BaseDynamicPruningMethod obj's underlying member method code with example usage: obj.apply_mask(module) and returns: self