def get_sparsity_summary(self, module: _torch.nn.Module) -> _Dict[str, _torch.tensor]:
        """
        Returns summary of the current state of pruning of module, indexed with name.
        """
        assert self._tensor_name is not None, "Module {} has not been pruned".format(module)
        weight: _torch.Tensor = getattr(module, self._tensor_name).detach()
        if hasattr(module, "weight_fake_quant") and hasattr(module.weight_fake_quant, "palettize"):
            weight = module.weight_fake_quant.palettize(weight)

        summary = {
            "structured_weight_sparsity": _structured_sparsity(weight),
            "unstructured_weight_sparsity": _unstructured_sparsity(weight),
        }

        if weight.size(0) % 2 == 0:
            summary["block2_weight_sparsity"] = _block2_sparsity(weight)
        else:
            summary["block2_weight_sparsity"] = -1  # Not applicable
        return summary

        Returns summary of the current state of pruning of module, indexed with name.
        
coremltools/optimize/torch/pruning/_base_pruning_method.py