def _validate_op_type(self, op_type):
        """
        Structural sparsity can only be applied to conv / linear weight.
        """
        if self._is_structural_pruning() and op_type not in self._SUPPORTED_OPS_FOR_STRUCTURAL_PRUNING:
            raise ValueError(f"block sparsity or n:m pruning does not support op type {op_type}.")

        Structural sparsity can only be applied to conv / linear weight.
        
coremltools/optimize/coreml/_config.py