def test_op_type_config_linear_quantizer_blockwise(self):
        """
        set_op_type allow the user to set different config for each op type for blockwise.
        Also checking that the config can be overwritten.
        """
        conv_config_1 = cto.coreml.OpLinearQuantizerConfig(
            mode="LINEAR_SYMMETRIC",
            dtype="int8",
            granularity="per_block",
            block_size=10,
            weight_threshold=5000,
        )
        # conv_config_2 overwrite conv_config_1
        conv_config_2 = cto.coreml.OpLinearQuantizerConfig(
            mode="LINEAR_SYMMETRIC",
            dtype="int4",
            granularity="per_block",
            block_size=3,
            weight_threshold=2000,
        )
        # The weight_threshold is super large so linear is not going to be compressed
        linear_config = cto.coreml.OpLinearQuantizerConfig(
            mode="LINEAR_SYMMETRIC",
            dtype="int4",
            granularity="per_block",
            weight_threshold=1000000,
        )
        conv_transpose_config = cto.coreml.OpLinearQuantizerConfig(
            mode="LINEAR",
            dtype="int8",
            granularity="per_block",
            block_size=10,
            weight_threshold=2000,
        )

        config = cto.coreml.OptimizationConfig()
        config.set_op_type("conv", conv_config_1)
        config.set_op_type("conv", conv_config_2)
        config.set_op_type("linear", linear_config)
        config.set_op_type("conv_transpose", conv_transpose_config)

        compressor = quantization.linear_quantize_weights(config=config)

        prog = self._get_test_program_3()
        compressor.apply(prog)

        expected_ops = [
            "constexpr_blockwise_shift_scale",
            "conv",
            "reshape",
            "linear",
            "matmul",
            "reshape",
            "constexpr_blockwise_shift_scale",
            "conv_transpose",
        ]
        assert get_op_types_in_program(prog) == expected_ops
        assert prog.find_ops(op_type="constexpr_blockwise_shift_scale")[0].offset is None
        assert prog.find_ops(op_type="constexpr_blockwise_shift_scale")[1].offset is not None

        set_op_type allow the user to set different config for each op type for blockwise.
        Also checking that the config can be overwritten.
        
coremltools/test/optimize/coreml/test_passes.py