def prepare(self, inplace: bool = False) -> _torch.nn.Module:
        """
        Prepares the model for pruning.

        Args:
            inplace (:obj:`bool`): If ``True``, model transformations are carried out in-place and
                the original module is mutated, otherwise a copy of the model is mutated and returned.
        """
        if _is_quant_prepared(self) and not inplace:
            raise RuntimeError(
                "If you are trying to run joint compression, pass inplace=True to ensure "
                "quantizer / palettizer and pruner are operating on the same model."
            )

        self._model = self._get_model_for_compression(inplace=inplace)
        return self._model

        Prepares the model for pruning.

        Args:
            inplace (:obj:`bool`): If ``True``, model transformations are carried out in-place and
                the original module is mutated, otherwise a copy of the model is mutated and returned.
        
coremltools/optimize/torch/pruning/_base_pruner.py