def test_optimization_config_load_pruner(self, from_yaml, yaml_as_string):
        """
        This test also checking the override of the config_type
        """
        config_dict = {
            "config_type": "OpThresholdPrunerConfig",
            "global_config": {
                "config_type": "OpMagnitudePrunerConfig",
                "target_sparsity": 0.3,
            },
            "op_type_configs": {
                "linear": {
                    "config_type": "OpMagnitudePrunerConfig",
                    "n_m_ratio": [4, 5],
                    "dim": 0,
                    "weight_threshold": 2,
                },
                "conv": {
                    "threshold": 0.01,
                    "minimum_sparsity_percentile": 0.01,
                    "weight_threshold": 45,
                },
            },
            "op_name_configs": {
                "op_1": {
                    "threshold": 0.1,
                    "minimum_sparsity_percentile": 0.1,
                    "weight_threshold": 1,
                },
                "op_2": {
                    "config_type": "OpMagnitudePrunerConfig",
                    "target_sparsity": 0.5,
                    "block_size": 100,
                },
            },
        }
        config = self.get_opt_config(config_dict, from_yaml, yaml_as_string)

        expected_global_config = quantization.OpMagnitudePrunerConfig(
            target_sparsity=0.3,
        )
        assert config.global_config == expected_global_config

        expected_config = quantization.OpMagnitudePrunerConfig(
            n_m_ratio=(4, 5),
            dim=0,
            weight_threshold=2,
        )
        assert config.op_type_configs["linear"] == expected_config

        expected_config = quantization.OpThresholdPrunerConfig(
            threshold=0.01,
            minimum_sparsity_percentile=0.01,
            weight_threshold=45,
        )
        assert config.op_type_configs["conv"] == expected_config

        expected_config = quantization.OpThresholdPrunerConfig(
            threshold=0.1,
            minimum_sparsity_percentile=0.1,
            weight_threshold=1,
        )
        assert config.op_name_configs["op_1"] == expected_config

        expected_config = quantization.OpMagnitudePrunerConfig(
            target_sparsity=0.5,
            block_size=100,
        )
        assert config.op_name_configs["op_2"] == expected_config

        This test also checking the override of the config_type
        
coremltools/test/optimize/coreml/test_passes.py