def from_module_and_params(
        cls, module: _torch.nn.Module, param_name: str = "weight", **params: _ParamsDict
    ) -> "BaseDynamicPruningMethod":
        """
        Factory method of this class that is tied to a particular nn.Module
        """
        pruning_method: BaseDynamicPruningMethod
        pruning_method = super(BaseDynamicPruningMethod, cls).apply(
            module, name=param_name, **params
        )
        pruning_method.bind_module(module)
        return pruning_method

        Factory method of this class that is tied to a particular nn.Module
        
coremltools/optimize/torch/pruning/_base_pruning_method.py